Skip to content

Python wrapper for the xeno-canto.org API to aid in downloading and managing recordings.

License

Notifications You must be signed in to change notification settings

dandavison/xeno-canto-py

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

39 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

Navigate to your desired file location in a terminal and then clone the repository with the following command:

git clone https://github.com/ntivirikin/xeno-canto-py

The only file required for operation is the xenocanto.py file, so feel free to remove the others or move xenocanto.py to another working directory.

You may also use the package manager pip to install xeno-canto-py to include in your Python projects.

pip install xeno-canto

Then import the module:

import xenocanto

Usage

Commands through the terminal are given in the following format:

-m 	[filters]	Metadata generation

-dl 	[filters] 	Download recordings

-d 	[filters]	Delete recordings

-p 	[num] 		Purge folders containing num or fewer recordings

-g 	[path] 		Generate metadata for provided library path (defaults to 'dataset/audio/')

filters are given in tag:value form in accordance with the API search guidelines. For help in building search terms, consult the xeno-canto API guide. The only exception is when providing English bird names as an argument to the -d command, which must be preceded with en: and have all spaces be replaced with underscores.

Examples of command usage are given below:

# Retrieving metadata
python xenocanto.py -m Bearded Bellbird q:A

# Downloading recordings
python xenocanto.py -dl Bearded Bellbird cnt:Brazil

# Delete recordings with ANY of specified criteria from
# library
python xenocanto.py -d q:D cnt:Brazil

# Purge folders with less than 10 recordings
python xenocanto.py -p 10

# Generate metadata for all recordings in the path
# (defaults to 'dataset/audio/')
python xenocanto.py -g

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

About

Python wrapper for the xeno-canto.org API to aid in downloading and managing recordings.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Python 100.0%