birdData
BirdData is a python wrapper for Xeno-canto API 2.0. Enables user to download bird data with one command line. BirdData supports multithreading download.
Environment
Download repo to local:
git clone [email protected]:realzza/birdData.git
Set up environment:
pip install -r requirement.txt
Usage
Single-thread
Download audio data for one bird species. Use scientific name starting with lowercase. e.g, cettia cetti.
python download.py --name "cettia cetti"
Download audio data for a file of species names. Format requirement: names divided by "\n"
python download.py --name name_file
General Usage:
usage: download.py [-h] --name NAME
download bird audios
optional arguments:
-h, --help show this help message and exit
--name NAME [1] name of one bird species; [2] file of bird species spaced
by '\n'
Multi-thread
Speed up downloading using multiple threads.
python download-mult.py --name "cettia cetti" --process-ratio 0.6
Download multiple birds in a file, format requirement: names divided by "\n"
python download-mult.py --name name_file --process-ratio 0.6
General Usage:
usage: download-mult.py [-h] --name NAME [--process-ratio PROCESS_RATIO]
download bird audios
optional arguments:
-h, --help show this help message and exit
--name NAME [1] name of one bird species; [2] file of bird species
spaced by '\n'
--process-ratio PROCESS_RATIO
float[0~1], define cpu utilities in downloading audios
[default: 0.8]
To-do
- [12.29] multiprocess download
- define sample rate prior to download
Contact
Feel free to file an issue had you encountered any problems. Have fun!