Skip to main content

aiobirdnetgo

PyPI version Python versions License: MIT

Asynchronous Python client library for the BirdNET-Go REST API and real-time Server-Sent Events (SSE) streaming.

Designed primarily for integration with Home Assistant Core and other Python asyncio applications.


Features

  • ⚡ Asynchronous: Built entirely on top of aiohttp and asyncio.
  • 🔍 Type-Safe: Frozen dataclasses with full typing support (py.typed).
  • 🐦 Real-Time Detection Streaming: Built-in SSE listener with automatic reconnection and heartbeat handling.
  • 📊 Dashboard KPIs & Analytics: Fetch daily species summaries, lifetime statistics, and detection streaks.
  • 🎙️ Multi-Source Audio: Discovers and maps audio devices and RTSP stream sources.
  • 🎛️ Engine Control: Restart analysis engine or reload classifier models remotely.

Installation

pip install aiobirdnetgo

Quickstart

Basic API Usage & KPIs

import asyncio
from aiobirdnetgo import BirdNetGoClient


async def main():
    async with BirdNetGoClient(host="192.168.1.50", port=8080) as client:
        # Check connectivity
        if await client.ping():
            print("Connected to BirdNET-Go!")

        # Get system health
        health = await client.get_health()
        print(f"Version: {health.version}, Status: {health.status}")

        # Get dashboard headline KPIs
        kpis = await client.get_kpis()
        print(f"Today's detections: {kpis.today_detections}")
        print(f"Lifetime species count: {kpis.lifetime_species}")
        print(f"Current streak: {kpis.detection_streak.days} days")


if __name__ == "__main__":
    asyncio.run(main())

Real-Time Detection Streaming (SSE)

import asyncio
from aiobirdnetgo import BirdNetGoClient


async def main():
    async with BirdNetGoClient(host="192.168.1.50", port=8080) as client:
        print("Listening for live bird detections...")

        stream = client.stream_detections()
        async for detection in stream:
            print(f"🐦 Detected: {detection.common_name} ({detection.scientific_name})")
            print(f"   Confidence: {detection.confidence * 100:.1f}%")
            print(f"   Source: {detection.source_name or detection.source_id}")
            if detection.bird_image:
                print(f"   Photo: {client.get_species_image_url(detection.scientific_name)}")


if __name__ == "__main__":
    asyncio.run(main())

Managing Audio Sources & Recent Detections

import asyncio
from aiobirdnetgo import BirdNetGoClient


async def main():
    async with BirdNetGoClient(host="192.168.1.50", port=8080) as client:
        # List audio sources (sound cards & RTSP streams)
        sources = await client.get_audio_sources()
        for source in sources:
            print(f"Source: {source.name} (ID: {source.id}, State: {source.state})")

        # Fetch recent detections
        detections = await client.get_recent_detections(limit=10)
        for det in detections:
            print(f"{det.time} - {det.common_name} ({det.confidence * 100:.0f}%)")


if __name__ == "__main__":
    asyncio.run(main())

Development & Testing

# Clone the repository
git clone https://github.com/TN-1/aiobirdnetgo.git
cd aiobirdnetgo

# Install dependencies and dev tools
pip install -e ".[dev]"

# Run linter and type checker
ruff check .
mypy src tests

# Run unit tests with coverage
pytest

Metadata

Release files for aiobirdnetgo 0.1.5

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

Source distribution (sdist)

Source distribution for aiobirdnetgo 0.1.5
File Size Uploaded
aiobirdnetgo-0.1.5.tar.gz 21.4 kB Details

Built distribution (wheel)

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

Total release size: 36.9 kB

Release files / aiobirdnetgo-0.1.5.tar.gz

Download URL aiobirdnetgo-0.1.5.tar.gz
Size 21.4 kB
Tags Source
SHA-256 checksum
How to use checksums
bca0d873dcf39a86de786e1053a75aeb864c36e0388eb1489b7c32ceae13b8ac
BLAKE2b-256 checksum
How to use checksums
b4c215c831cd0f80f8b009547af57c80bd3bb40697c2aaa2d3e9c5b2064d8a83
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 Sep 6, 2026.

Transparency log

Release files / aiobirdnetgo-0.1.5-py3-none-any.whl

Download URL aiobirdnetgo-0.1.5-py3-none-any.whl
Size 15.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
d64ea198f134ada6aa8354ad3d0c23e7c84c37177f27d6b0efb583f7f789c549
BLAKE2b-256 checksum
How to use checksums
decc39afe7cba97cfd7c0d6b58e8ffefe701a834922d950e2db70aaf8a205b9d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 Sep 6, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

0.1.5 This release

2 release files

0.1.4

2 release files

0.1.3

2 release files

0.1.2

2 release files

0.1.1

2 release files

0.1.0

2 release files

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