Skip to main content

bioamla

PyPI version Python License: MIT CI Docs

A Python library and command-line tool for bioacoustics: audio and recorder metadata, signal processing, acoustic indices, event detection, spectrograms, species catalogs, datasets, and Audio Spectrogram Transformer (AST) models. Run it on your laptop, or on a server next to your recordings.

Install

Python 3.11 or newer, in a virtual environment:

pip install "bioamla[all,cli]"     # everything, plus the `bioamla` command
pip install "bioamla[audio,cli]"   # or only the parts you need
pip install bioamla                # the slim library alone: no PyTorch, librosa or plots
Extra For
(none) audio I/O and info, recorder metadata, batch runs, datasets, catalogs
audio signal processing (filter, denoise, segment, ...) and playback
viz spectrograms, plots and videos
indices acoustic indices
detect event detection
ml AST prediction, training and embeddings (PyTorch)
cluster dimensionality reduction and clustering
server bioamla serve
cli the bioamla command
all every extra but cli

Using a feature whose extra is missing tells you what to install.

System dependencies

Formats other than WAV, FLAC and OGG, and spectrogram videos, need FFmpeg (apt install ffmpeg, brew install ffmpeg, or conda install -c conda-forge ffmpeg). AST prediction can use its shared libraries (versions 4 to 8) to decode audio. Check what you have with bioamla system deps.

Quickstart

bioamla audio info recording.wav                  # duration, rate, channels, bit depth
bioamla audio metadata recording.wav              # recorder metadata: when, where, which unit
bioamla audio visualize recording.wav -o spec.png
bioamla indices compute recording.wav             # ACI, ADI, AEI, BIO, NDSI, entropy
bioamla detect energy recording.wav -o detections.csv
bioamla models ast predict frog.wav --model-path bioamla/scp-frogs --top-k 3

# The same over a folder, or a CSV with a file_name column (a copy with the results
# added goes to the output folder):
bioamla batch index --input-dir ./recordings --output-dir ./out
bioamla batch detect energy --input-file recordings.csv --output-dir ./out

bioamla --json <command> prints one JSON document, for scripts and agents. Every command has --help, and the CLI reference lists them all.

Everything the command does, the library does too:

from bioamla.audio import load_audio_data
from bioamla.indices import compute_all_indices
from bioamla.ml import classify_file

audio = load_audio_data("recording.wav")
print(compute_all_indices(audio.samples, audio.sample_rate).aci)
print(classify_file("frog.wav", model_path="bioamla/scp-frogs").predictions[0].predicted_label)

Errors raise bioamla.exceptions.BioamlaError (or a subclass).

Workspaces

A workspace is a project folder that remembers its recordings, settings and history:

bioamla workspace init costa-rica && cd costa-rica
bioamla workspace add /data/recordings/site1      # link recordings where they are
bioamla workspace config set detect.energy.threshold_db -25
bioamla workspace history                          # what ran, when, and what it wrote

Working on a server

Run bioamla on the machine that holds the recordings (or the GPU), and drive it from your laptop with the same commands:

# On the server (it listens on localhost only)
pip install "bioamla[all,cli]"
bioamla serve --root ~/bioamla-workspaces --allow-link /data/recordings

# On the laptop: reach it through an SSH tunnel, then add it as a remote
ssh -N -L 8765:localhost:8765 lab-server &
bioamla remote add lab http://localhost:8765
export BIOAMLA_LAB_TOKEN=...                       # from the server's token file
bioamla remote workspaces lab --create costa-rica
bioamla remote upload lab costa-rica rec.wav --to raw
bioamla --remote lab:costa-rica detect energy raw/rec.wav

The output is the same as a local run's. See Running the server for the token, a VPN instead of a tunnel, and systemd.

Agent skills

skills/ has skills that let an AI agent drive bioamla, locally or on a server: inventory describes a folder of recordings, and label does a first pass of labeling, sending anything uncertain to a person. See Agent skills.

API keys

The catalog commands read EBIRD_API_KEY, XC_API_KEY (Xeno-canto) and HF_TOKEN (Hugging Face) from the environment, or from a .env file in the working directory or a parent (only those three keys, and an exported variable wins). Nothing else needs a key.

More

Citation

If you use bioamla in research, please cite the Zenodo DOI of the version you used, or use GitHub's "Cite this repository" button (CITATION.cff):

@software{mcmeen_bioamla,
  author  = {McMeen, John},
  title   = {bioamla: Bioacoustics \& Machine Learning Applications},
  year    = {2026},
  license = {MIT},
  url     = {https://github.com/jmcmeen/bioamla}
}

License

MIT. See LICENSE.

Metadata

Release files for bioamla 0.4.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for bioamla 0.4.2
File Size Uploaded Provenance Actions
bioamla-0.4.2.tar.gz 441.7 kB With provenance Details for bioamla-0.4.2.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for bioamla 0.4.2
File Interpreter ABI Platform Actions
bioamla-0.4.2-py3-none-any.whl Python 3 none any Details for bioamla-0.4.2-py3-none-any.whl

Total release size: 977.0 kB

Release files / bioamla-0.4.2.tar.gz

Download URL bioamla-0.4.2.tar.gz
Size 441.7 kB
Tags Source
SHA-256 checksum
How to use checksums
7d2ce871e5e44441ed59b5761a61833f05b7f0aa7967eb4dad84da3d05db463c
BLAKE2b-256 checksum
How to use checksums
689d07e4c2c7f1348516159d34452e1b7c42e39d96126df5af9fadc6f3139cf5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 8, 2026.

Transparency log

Release files / bioamla-0.4.2-py3-none-any.whl

Download URL bioamla-0.4.2-py3-none-any.whl
Size 535.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
e42dba1d3dce06826b6c659c9833b4a5db82895778bbc52ef83d9b55a8a85893
BLAKE2b-256 checksum
How to use checksums
a512c8367ee07a11327b926728630de84256e995f3a5da02b4a625ee67b0adea
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 8, 2026.

Transparency log

Security for bioamla 0.4.2

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for bioamla-0.4.2.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 8, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.4.2 This release

2 release files Full provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page