Skip to main content

A XenoCanto API wrapper for Python

Project description

CantoPy

CantoPy is an API wrapper and download utility designed for easy scraping of animal sound recordings from the Xeno-Canto database.

Installation

Download the latest published version of this package from PyPI by running the following command:

pip install cantopy

Usage

The CantoPy package contains three main components to look up and download recordings from the Xeno-Canto API: the Query class, FetchManager, and DownloadManager.

The following example demonstrates how to use these components to retrieve high-quality recordings of a common blackbird (Turdus merula):

from cantopy import Query, FetchManager, DownloadManager

# Initialize the search query
query = Query(species_name="common blackbird", quality="A")

# Find matching query results on the Xeno-Canto database
query_result = FetchManager.send_query(query, max_pages=3)

# Initialize a DownloadManager
download_manager = DownloadManager("<download_base_folder>", max_workers=2)

# Download the corresponding recordings of the retrieved results
download_manager.download_all_recordings_in_queryresult(query_result)

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

cantopy-0.2.4.tar.gz (10.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

cantopy-0.2.4-py3-none-any.whl (13.6 kB view details)

Uploaded Python 3

File details

Details for the file cantopy-0.2.4.tar.gz.

File metadata

  • Download URL: cantopy-0.2.4.tar.gz
  • Upload date:
  • Size: 10.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.7.1 CPython/3.10.15 Linux/6.5.0-1025-azure

File hashes

Hashes for cantopy-0.2.4.tar.gz
Algorithm Hash digest
SHA256 c726028b0432b46c435166b0852283606147b371a5c834878a28a5214e5ecff2
MD5 fdb54f9e4812d991bda545a324c4c5c9
BLAKE2b-256 f0888c06019de03a88b5ec4ec2413636dd16fe462ab5d44a01cc9dfb660e11cb

See more details on using hashes here.

File details

Details for the file cantopy-0.2.4-py3-none-any.whl.

File metadata

  • Download URL: cantopy-0.2.4-py3-none-any.whl
  • Upload date:
  • Size: 13.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.7.1 CPython/3.10.15 Linux/6.5.0-1025-azure

File hashes

Hashes for cantopy-0.2.4-py3-none-any.whl
Algorithm Hash digest
SHA256 0e9b6952cb7f9248e9a54fe5966ace1c39d32b6355c14db83b51e588b094f23e
MD5 92b70c089948efa0e218303a150753aa
BLAKE2b-256 55d5576fef0d3f7a049004e1c2f850494d869bf8750e2fbc939025d4b680b733

See more details on using hashes here.

Supported by

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