https://github.com/riggsd/guano-py
Python reference implementation of the GUANO bat acoustics metadata specification
https://github.com/riggsd/guano-py
anabat bat-acoustics bat-detector bats guano metadata
Last synced: about 2 months ago
JSON representation
Python reference implementation of the GUANO bat acoustics metadata specification
- Host: GitHub
- URL: https://github.com/riggsd/guano-py
- Owner: riggsd
- License: mit
- Created: 2015-10-13T00:39:07.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2025-03-09T04:52:21.000Z (3 months ago)
- Last Synced: 2025-03-27T21:38:57.845Z (2 months ago)
- Topics: anabat, bat-acoustics, bat-detector, bats, guano, metadata
- Language: Python
- Homepage: http://guano-md.org
- Size: 175 KB
- Stars: 14
- Watchers: 5
- Forks: 5
- Open Issues: 6
-
Metadata Files:
- Readme: README.rst
- License: LICENSE.txt
Awesome Lists containing this project
README
guano-py
========This is the `Python`_ reference implementation for `GUANO`_, the “Grand
Unified Acoustic Notation Ontology”, a metadata format for bat acoustics
recordings. It includes a production-ready Python module with full
support for reading and writing GUANO metadata, as well as several
helpful commandline utilities.For more information about GUANO metadata itself, including the format
specification, see the GUANO project homepage: http://guano-md.orgDocumentation for guano-py can be found at: http://guano-py.readthedocs.io
Requirements
============- Python 3.6+
Installation
============Download and install magically from the Python Package Index::
$> pip install -U guano
In addition to having the ``guano`` Python module available for use in
your own software, you’ll also have a small collection of `useful
scripts`_ to use.Alternately, you can check out the project from GitHub and install
locally in developer mode to hack on it yourself::$> git clone https://github.com/riggsd/guano-py.git
$> cd guano-py
$> python setup.py developMaster:|Master Tests| Dev:|Dev Tests| |Documentation Status|
API Usage
=========.. code:: python
from guano import GuanoFile
# load a .WAV file with (or without) GUANO metadata
g = GuanoFile('test.wav')# get and set metadata values like a Python dict
print g['GUANO|Version']
>>> 1.0print g['Make'], g['Model']
>>> 'Pettersson', 'D500X'g['Species Manual ID'] = 'Myso'
g['Note'] = 'I love GUANO!'
# namespaced fields can be specified separately or pipe-delimited
print g['PET', 'Gain'], g['PET|Gain']
>>> 80, 80g['SB|Consensus'] = 'Epfu'
g['SB', 'Consensus'] = 'Epfu'# print all the metadata values
for key, value in g.items():
print '%s: %s' % (key, value)# write the updated .WAV file back to disk
g.write()# have some GUANO metadata from some other source? load it from a string
g = GuanoFile.from_string('GUANO|Version:1.0\nTags:voucher,hand-release')# write GUANO metadata somewhere else, say an Anabat file or text file
with open('sidecar_file.guano', 'wb') as outfile:
outfile.write( g.serialize() )# teach the parser to recognize custom metadata fields
GuanoFile.register('Anabat', ['Humidity', 'Temperature'], float)
GuanoFile.register('SB', 'Thumbnail Image', guano.base64decode).. _Python: http://python.org
.. _GUANO: http://guano-md.org
.. _useful scripts: bin/.. |Master Tests| image:: https://github.com/riggsd/guano-py/actions/workflows/python-tests.yml/badge.svg?branch=master
:target: https://github.com/riggsd/guano-py/actions/workflows/python-tests.yml?query=branch%3Amaster
.. |Dev Tests| image:: https://github.com/riggsd/guano-py/actions/workflows/python-tests.yml/badge.svg?branch=dev
:target: https://github.com/riggsd/guano-py/actions/workflows/python-tests.yml?query=branch%3Adev
.. |Documentation Status| image:: https://readthedocs.org/projects/guano-py/badge/?version=latest
:target: http://guano-py.readthedocs.io/en/latest/?badge=latest