Skip to main content

xeno-canto.org API Wrapper

Project description

xeno-canto API Wrapper

xeno-canto-py is an API wrapper designed to help users easily download xeno-canto.org recordings and associated information.

Originally created to aid in data collection and filtering for the training of machine learning models.

Installation

Use the package manager pip to install xeno-canto-py, or copy and paste the xenocanto.py file into your working directory.

pip install xenocanto

Usage

get_json and get_mp3 can be used to retrieve the JSON file and recordings from a query. Queries must be made according to the conventions detailed on the xeno-canto.org API search tips page found here.

The following commands will retrieve the query information for the genus Otis through get_json and then the recordings through get_mp3. Both functions will return a list of file paths to the newly saved files for further use if required.

import xenocanto


json_list = xenocanto.get_json(['gen:Otis'])
mp3_list = xenocanto.get_mp3(json_list)

get_rec calls get_json with the provided query and immediately calls get_mp3 afterwards.

The following command will produce the same result as above.

import xenocanto

xenocanto.get_rec(['gen:Otis'])

This will generate two folders, queries and recordings which will contain the JSON files with query data and recordings as MP3 files respectively.

Roadmap

  • Add filtering of recordings folders (mainly by quality and background species)
  • Add basic pre-processing abilities (file conversion, re-sampling, etc.) on a as-needed basis
  • Add entrypoints for easier use

I am always open to suggestions for features!

Contributing

All pull requests are welcome! If any issues are found, please do not hesitate to bring them to my attention.

Acknowledgements

Thank you to the team at xeno-canto.org and all its contributors for putting together such an amazing database.

License

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

xeno-canto-1.0.0.tar.gz (4.5 kB view details)

Uploaded Source

Built Distribution

xeno_canto-1.0.0-py3-none-any.whl (4.3 kB view details)

Uploaded Python 3

File details

Details for the file xeno-canto-1.0.0.tar.gz.

File metadata

  • Download URL: xeno-canto-1.0.0.tar.gz
  • Upload date:
  • Size: 4.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.7.2

File hashes

Hashes for xeno-canto-1.0.0.tar.gz
Algorithm Hash digest
SHA256 d6b179281bac5f2905a424d33f38ac791f193960a5805d04aa99c4a849d3072b
MD5 1a87814e3ff485f9c3e64cce4957d7f2
BLAKE2b-256 c1b26f2244b696105492a5f0dff4d479870e0f97a1159e44803c976dbca8bf6c

See more details on using hashes here.

File details

Details for the file xeno_canto-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: xeno_canto-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 4.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.7.2

File hashes

Hashes for xeno_canto-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 6168b876d3cf06c0d36376e69994bd3c428845ddef94f07e04b027ed65283099
MD5 5a38d6d2da7384cb7ef19022d7079c93
BLAKE2b-256 e96d41223882dbdf1516fc87aa3e718cea44e0ad3d202075ff3a6ee877031aac

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page