2023-09-27 11:14:46 -06:00
|
|
|
# xeno-crufto
|
|
|
|
Scripts for working with the xeno-canto sound archive.
|
|
|
|
|
|
|
|
https://spacecruft.org/deepcrayon/xeno-crufto
|
|
|
|
|
|
|
|
|
|
|
|
# Install
|
|
|
|
Install thusly.
|
|
|
|
|
|
|
|
Using Debian Stable (12/Bookworm).
|
|
|
|
|
|
|
|
Install thine dependencies:
|
|
|
|
```
|
|
|
|
sudo apt update
|
2023-09-27 12:13:03 -06:00
|
|
|
sudo apt install git python3-pip python3-virtualenv
|
2023-09-27 11:14:46 -06:00
|
|
|
```
|
|
|
|
|
|
|
|
Clone repo:
|
|
|
|
```
|
|
|
|
git clone https://spacecruft.org/deepcrayon/xeno-crufto
|
|
|
|
cd xeno-crufto/
|
|
|
|
```
|
|
|
|
|
2023-09-27 11:46:44 -06:00
|
|
|
Set up Python to taste, such as:
|
|
|
|
```
|
|
|
|
virtualenv env
|
|
|
|
source env/bin/activate
|
|
|
|
pip install --upgrade pip setuptools wheel
|
|
|
|
```
|
|
|
|
|
|
|
|
Install Python dependencies.
|
|
|
|
|
|
|
|
```
|
|
|
|
pip install -r requirements.txt
|
|
|
|
```
|
|
|
|
|
2023-09-28 09:37:07 -06:00
|
|
|
Using `jq` isn't a requirement, but it is handy to have:
|
2023-09-27 12:13:03 -06:00
|
|
|
|
|
|
|
```
|
|
|
|
sudo apt install jq
|
|
|
|
```
|
|
|
|
|
2023-09-27 11:46:44 -06:00
|
|
|
|
|
|
|
# Usage
|
2023-09-27 13:48:41 -06:00
|
|
|
Minimally working. Some queries work, such as:
|
2023-09-27 13:07:15 -06:00
|
|
|
|
|
|
|
```
|
|
|
|
$ ./xeno-crufto --cnt brazil
|
|
|
|
```
|
|
|
|
|
|
|
|
Help:
|
|
|
|
|
|
|
|
```
|
|
|
|
$ ./xeno-crufto -h
|
2023-09-28 09:37:07 -06:00
|
|
|
usage: xeno-crufto [-h] [--api API] [--dry-run | --no-dry-run] [--query QUERY]
|
|
|
|
[--animal-seen {yes,no,unknown}] [--auto {yes,no,unknown}]
|
|
|
|
[--cnt CNT] [--date DATE] [--dvc DVC] [--en EN]
|
|
|
|
[--file FILE] [--file-name FILE_NAME] [--gen GEN]
|
|
|
|
[--group {bats,birds,grasshoppers}] [--id ID] [--lat LAT]
|
|
|
|
[--lng LNG] [--loc LOC] [--method METHOD] [--mic MIC]
|
|
|
|
[--playback-used {yes,no,unknown}] [--q Q] [--rec REC]
|
|
|
|
[--regnr REGNR] [--rmk RMK] [--sex {female,male,unknown}]
|
|
|
|
[--smp SMP] [--sp SP] [--ssp SSP]
|
|
|
|
[--stage {adult,juvenile,nesting,nymph,subadult,unknown}]
|
|
|
|
[--temperature TEMPERATURE]
|
2023-09-28 09:42:00 -06:00
|
|
|
[--type {aberrant,"alarm call","begging call",call,"calling song","courtship song","dawn song","distress call","distrubance song",drumming,duet,echolocation,"female song","flight call","flight song",imitation,"nocturnal flight call","rivalry song","searching song","social call",song,subsong,unknown}]
|
2023-09-28 09:37:07 -06:00
|
|
|
[--uploaded UPLOADED]
|
2023-09-27 13:07:15 -06:00
|
|
|
|
|
|
|
options:
|
|
|
|
-h, --help show this help message and exit
|
2023-09-27 13:50:20 -06:00
|
|
|
--api API API URL (default https://xeno-
|
|
|
|
canto.org/api/2/recordings)
|
|
|
|
--dry-run, --no-dry-run
|
|
|
|
Print URI but don't run query (default False)
|
2023-09-28 09:37:07 -06:00
|
|
|
--query QUERY Arbitrary query string (default None)
|
|
|
|
--animal-seen {yes,no,unknown}
|
2023-09-27 13:07:15 -06:00
|
|
|
was the recorded animal seen?
|
2023-09-28 09:37:07 -06:00
|
|
|
--auto {yes,no,unknown}
|
|
|
|
(non-supervised) recording?
|
|
|
|
--cnt CNT the country where the recording was made (example:
|
|
|
|
brazil)
|
|
|
|
--date DATE the date that the recording was made (example:
|
|
|
|
2022-09-18)
|
|
|
|
--dvc DVC recording device used (example: "Panasonic RR-US300")
|
|
|
|
--en EN the English name of the species (example: "Great
|
|
|
|
Tinamou")
|
|
|
|
--file FILE the URL to the audio file (example: https://xeno-
|
|
|
|
canto.org/770944/download)
|
2023-09-27 13:07:15 -06:00
|
|
|
--file-name FILE_NAME
|
2023-09-28 09:37:07 -06:00
|
|
|
the original file name of the audio file (example:
|
|
|
|
"XC483178-Tinamus tao_Rio Azul_1032.mp3")
|
|
|
|
--gen GEN the generic name of the species (example: "Rhea")
|
|
|
|
--group {bats,birds,grasshoppers}
|
|
|
|
the group to which the species belongs
|
2023-09-27 13:07:15 -06:00
|
|
|
--id ID the catalogue number of the recording on xeno-canto
|
2023-09-28 09:37:07 -06:00
|
|
|
(example: 830675)
|
2023-09-27 13:07:15 -06:00
|
|
|
--lat LAT the latitude of the recording in decimal coordinates
|
2023-09-28 09:37:07 -06:00
|
|
|
(example: -26.7144)
|
2023-09-27 13:07:15 -06:00
|
|
|
--lng LNG the longitude of the recording in decimal coordinates
|
2023-09-28 09:37:07 -06:00
|
|
|
(example: -67.7537)
|
|
|
|
--loc LOC the name of the locality (example "Araponga, Minas
|
|
|
|
Gerais")
|
|
|
|
--method METHOD the recording method (example: "field recording")
|
|
|
|
--mic MIC microphone used (example: "Telinga + AT4022")
|
|
|
|
--playback-used {yes,no,unknown}
|
2023-09-27 13:07:15 -06:00
|
|
|
was playback used to lure the animal?
|
2023-09-28 09:37:07 -06:00
|
|
|
--q Q the current quality rating for the recording (Letters
|
|
|
|
A to E. Prepend > or < for better or worse than.
|
|
|
|
Example: ">C" for A and B.)
|
|
|
|
--rec REC the name of the recordist (example: "Jeff Moe")
|
2023-09-27 13:07:15 -06:00
|
|
|
--regnr REGNR registration number of specimen (when collected)
|
|
|
|
--rmk RMK additional remarks by the recordist
|
2023-09-28 09:37:07 -06:00
|
|
|
--sex {female,male,unknown}
|
|
|
|
the sex of the animal
|
|
|
|
--smp SMP sample rate (example: 48000)
|
|
|
|
--sp SP the specific name (epithet) of the species (example:
|
|
|
|
obsoletus)
|
|
|
|
--ssp SSP the subspecies name (subspecific epithet) (example:
|
|
|
|
americana)
|
|
|
|
--stage {adult,juvenile,nesting,nymph,subadult,unknown}
|
|
|
|
the life stage of the animal
|
2023-09-27 13:07:15 -06:00
|
|
|
--temperature TEMPERATURE
|
2023-09-27 13:50:20 -06:00
|
|
|
temperature during recording (applicable to specific
|
|
|
|
groups only)
|
2023-09-28 09:42:00 -06:00
|
|
|
--type {aberrant,"alarm call","begging call",call,"calling song","courtship song","dawn song","distress call","distrubance song",drumming,duet,echolocation,"female song","flight call","flight song",imitation,"nocturnal flight call","rivalry song","searching song","social call",song,subsong,unknown}
|
2023-09-28 09:37:07 -06:00
|
|
|
the sound type of the recording
|
2023-09-27 13:07:15 -06:00
|
|
|
--uploaded UPLOADED the date that the recording was uploaded to xeno-canto
|
2023-09-28 09:37:07 -06:00
|
|
|
(example: 2022-03-02)
|
2023-09-27 13:07:15 -06:00
|
|
|
```
|
2023-09-27 11:46:44 -06:00
|
|
|
|
|
|
|
|
|
|
|
# Development
|
|
|
|
To "develop", install the requirements:
|
|
|
|
|
|
|
|
```
|
|
|
|
pip install -r requirements-dev.txt
|
|
|
|
```
|
|
|
|
|
|
|
|
Then run black on the Python files for nice formatting:
|
|
|
|
|
|
|
|
```
|
2023-09-27 11:49:05 -06:00
|
|
|
black xeno-crufto*
|
2023-09-27 11:46:44 -06:00
|
|
|
```
|
|
|
|
|
2023-09-27 11:14:46 -06:00
|
|
|
|
2023-09-27 11:17:54 -06:00
|
|
|
# Upstream
|
2023-09-27 11:49:05 -06:00
|
|
|
The main upstream project.
|
|
|
|
* https://xeno-canto.org
|
2023-09-27 11:17:54 -06:00
|
|
|
|
|
|
|
|
2023-09-27 11:46:44 -06:00
|
|
|
# Other xeno-canto projects
|
|
|
|
The following projects are noted for further research.
|
|
|
|
They all have libre licenses, are somewhat recently
|
|
|
|
updated, and are in Python.
|
|
|
|
Many xeno-canto software projects on Github have no licenses.
|
|
|
|
|
|
|
|
|
|
|
|
Unsupervised classification to improve the quality of a bird song.
|
|
|
|
recording dataset.
|
|
|
|
* https://github.com/ear-team/bambird
|
|
|
|
|
|
|
|
XenoPy: Python wrapper for Xeno-canto API 2.0. Supports multiprocessing.
|
|
|
|
* https://github.com/realzza/xenopy
|
|
|
|
|
2023-09-27 12:13:03 -06:00
|
|
|
easybird: Python toolkit for Bird Activity Detection (BAD).
|
|
|
|
* https://github.com/realzza/easybird
|
|
|
|
|
2023-09-27 11:46:44 -06:00
|
|
|
train bird song recognition with a xeno canto database.
|
|
|
|
* https://github.com/ImeneYAHIAOUI/project_edge_ia
|
|
|
|
|
|
|
|
A Python wrapper for the Xeno Canto API.
|
|
|
|
* https://github.com/NickEvans4130/xcpy
|
|
|
|
|
|
|
|
Python wrapper for the xeno-canto.org API to aid in downloading and
|
|
|
|
managing recordings.
|
|
|
|
* https://github.com/ntivirikin/xeno-canto-py
|
|
|
|
|
|
|
|
This python script automated downloading audio recordings of different
|
|
|
|
bird calls.
|
|
|
|
* https://github.com/arghyasahoo/Xeno-Canto-Downloader
|
|
|
|
|
|
|
|
A tool for getting xeno-canto bird calls and transforming them for
|
|
|
|
use in TensorFlow.
|
|
|
|
* https://github.com/AFairbairn/bioSong
|
|
|
|
|
|
|
|
|
|
|
|
# Status
|
|
|
|
Alpha, initial development.
|
|
|
|
|
|
|
|
|
2023-09-27 11:17:54 -06:00
|
|
|
# Disclaimer
|
|
|
|
I'm not a programmer and I know less about birds.
|
|
|
|
|
|
|
|
|
|
|
|
# Copyright
|
|
|
|
Unofficial project, not related to xeno-canto.
|
|
|
|
|
|
|
|
Upstream sources under their respective copyrights.
|
|
|
|
|
|
|
|
|
2023-09-27 11:14:46 -06:00
|
|
|
# License
|
|
|
|
Dual licensed under the
|
|
|
|
Creative Commons Attribution-ShareAlike 4.0 International
|
|
|
|
and the Apache 2.0 license.
|
|
|
|
The content may be used under either license.
|
|
|
|
|
|
|
|
*Copyright © 2023, Jeff Moe.*
|