Skip to main content

Async Python client for Nanit baby cameras

Project description

aionanit

Async Python client library for Nanit baby cameras.

Features

  • Authentication: Email/password login, MFA verification, automatic token refresh.
  • WebSocket: Protobuf-over-WebSocket communication with cameras (cloud and local).
  • REST API: Baby metadata, cloud events, snapshots.
  • Streaming: RTMPS URL construction for live video.
  • Push-based: Subscribe to real-time camera state changes (sensors, settings, controls).

Installation

pip install aionanit

Quick Start

import aiohttp
from aionanit import NanitClient

async with aiohttp.ClientSession() as session:
    client = NanitClient(session)

    # Login
    tokens = await client.async_login("you@example.com", "password")

    # Get babies
    babies = await client.async_get_babies()
    baby = babies[0]

    # Connect to camera
    camera = client.camera(baby.camera_uid, baby.uid)
    await camera.async_start()

    # Subscribe to state changes
    def on_event(event):
        print(f"Sensors: {event.state.sensors}")

    unsub = camera.subscribe(on_event)

    # Get RTMPS stream URL
    url = await camera.async_get_stream_rtmps_url()
    print(f"Stream: {url}")

    # Cleanup
    unsub()
    await client.async_close()

Requirements

  • Python 3.12+
  • aiohttp >= 3.9.0
  • protobuf >= 6.0

License

MIT

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

aionanit-1.6.0b5.tar.gz (46.4 kB view details)

Uploaded Source

Built Distribution

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

aionanit-1.6.0b5-py3-none-any.whl (32.5 kB view details)

Uploaded Python 3

File details

Details for the file aionanit-1.6.0b5.tar.gz.

File metadata

  • Download URL: aionanit-1.6.0b5.tar.gz
  • Upload date:
  • Size: 46.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.13

File hashes

Hashes for aionanit-1.6.0b5.tar.gz
Algorithm Hash digest
SHA256 86c78abd2647815b9223fb75c3457719d7bf449b5fa30c050aa8875f4bcbf977
MD5 410daf4e9a1b0e3e95dcb61a56e4ec44
BLAKE2b-256 abd7eefa9962faa88ae81b13387e2b07a88fb6e35b5be24b87e95ccbb97ab4ea

See more details on using hashes here.

Provenance

The following attestation bundles were made for aionanit-1.6.0b5.tar.gz:

Publisher: release.yaml on wealthystudent/ha-nanit

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file aionanit-1.6.0b5-py3-none-any.whl.

File metadata

  • Download URL: aionanit-1.6.0b5-py3-none-any.whl
  • Upload date:
  • Size: 32.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.13

File hashes

Hashes for aionanit-1.6.0b5-py3-none-any.whl
Algorithm Hash digest
SHA256 2c03f75c722d17521e63cb0b5e2658ec1dbf0a0101a1351f5fbb669108225cf9
MD5 233cc14813d8be6a161d7bba151ac093
BLAKE2b-256 d28a559f94668b47828e2b8ba8b1e0b30c1ed2fa4f8609c50c4474704a9d4e26

See more details on using hashes here.

Provenance

The following attestation bundles were made for aionanit-1.6.0b5-py3-none-any.whl:

Publisher: release.yaml on wealthystudent/ha-nanit

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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