Samples

The module samples has a collection of data samples to be used as examples.

get_audio_sample(dataset[, extract_path])

Get Leec Audio Samples available in maui.

get_xc_data(q, extract_path)

Retrieves and downloads Xeno-canto data based on a set of query parameters.

maui.samples.get_audio_sample(dataset, extract_path=None)[source]

Get Leec Audio Samples available in maui.

Return type:

DataFrame

Parameters:
datasetstr

Dataset to be loaded. The available datasets are: leec

extract_pathstr

Directory to extract sample files

Returns:
dfpandas.DataFrame

A DataFrame containing information about the audio samples.

Examples

To retrieve Leec audio samples and store the information in a DataFrame, you can call this function as follows:

>>> from maui import samples
>>> df = samples.get_audio_sample(dataset="leec")
maui.samples.get_xc_data(q, extract_path)[source]

Retrieves and downloads Xeno-canto data based on a set of query parameters.

Return type:

DataFrame

Parameters:
qdict

A dictionary of query parameters to filter recordings from Xeno-canto.

extract_pathstr

The directory where the audio files will be saved.

Returns:
pd.DataFrame

A DataFrame containing the recordings data from Xeno-canto, with additional columns for the local file paths and file download status.

Raises:
ValueError

If unexpected query parameters are provided.

Notes

  • The method first validates the query dictionary to ensure only valid keys are used.

  • After retrieving the recordings data using the _get_xc_dataset method, it downloads the audio files using the _download_xc_files method.