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.6.tar.gz (10.5 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.6-py3-none-any.whl (13.7 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: cantopy-0.2.6.tar.gz
  • Upload date:
  • Size: 10.5 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.6.tar.gz
Algorithm Hash digest
SHA256 73c6ae8aa71c3160f99d280d9fb59ff56891957b1b2000d5bd1a69ef6683ed69
MD5 c7ceb544f8eea48a6c90f8db34506636
BLAKE2b-256 b75e91fccf4d6a3c15c1dcebe065a015a0d542876518b8c33199f8fe1278e5f2

See more details on using hashes here.

File details

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

File metadata

  • Download URL: cantopy-0.2.6-py3-none-any.whl
  • Upload date:
  • Size: 13.7 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.6-py3-none-any.whl
Algorithm Hash digest
SHA256 757cd3980023405b6dc449217e586f6b3c0846d5b59190917c2ba1f0d34c34b5
MD5 59f586e223f759e4b2e708db8ab0f52b
BLAKE2b-256 464af5c14da834890c0ce36b76b65b25b1dc3363636284ca0909199b1f147f62

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