Skip to main content

Async Python client for the Woddle Smart Baby Scale API

Project description

pywoddle

Async Python client for the Woddle Smart Baby Scale API.

Installation

pip install pywoddle

Usage

import asyncio
from pywoddle import WoddleAuth, WoddleClient

async def main():
    auth = WoddleAuth(email="you@example.com", password="yourpassword")
    await auth.authenticate()

    client = WoddleClient(auth)

    # List babies on your account
    babies = await client.fetch_babies()
    for baby in babies:
        print(f"{baby.first_name} (due: {baby.due_date})")

    # Get recent activities (diapers, feedings, etc.)
    activities = await client.fetch_recent_activities()
    for activity in activities:
        print(f"{activity.baby_name}: {activity.activity_type}/{activity.sub_type} at {activity.log_time}")

    # List registered devices
    devices = await client.fetch_devices()
    for device in devices:
        print(f"{device.name} (serial: {device.device_id}, fw: {device.firmware_version})")

    await client.close()

asyncio.run(main())

API Reference

Authentication

  • WoddleAuth(email, password, session=None) — Create auth instance
  • await auth.authenticate() — Login and obtain JWT token
  • await auth.ensure_valid_token() — Re-authenticate if token expired
  • await auth.close() — Close the HTTP session

Client

  • WoddleClient(auth) — Create API client
  • await client.fetch_babies() — List all babies → list[WoddleBaby]
  • await client.fetch_baby_details(baby_id) — Get baby details → WoddleBaby
  • await client.fetch_recent_activities() — Recent activities → list[WoddleActivity]
  • await client.fetch_devices() — Registered devices → list[WoddleDevice]
  • await client.fetch_user_profile() — User profile → WoddleUserProfile
  • await client.close() — Close the HTTP session

Models

  • WoddleBabybaby_id, first_name, last_name, due_date, date_of_birth, gender
  • WoddleActivityactivity_id, baby_name, activity_type, sub_type, log_time
  • WoddleDevicedevice_id, name, firmware_version, possession
  • WoddleUserProfileuser_id, first_name, last_name, email, relationship, measurement

Exceptions

  • WoddleError — Base exception
  • WoddleAuthError — Authentication failures
  • WoddleApiError — API request errors (includes status_code attribute)

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

pywoddle-0.2.0.tar.gz (11.9 kB view details)

Uploaded Source

Built Distribution

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

pywoddle-0.2.0-py3-none-any.whl (9.5 kB view details)

Uploaded Python 3

File details

Details for the file pywoddle-0.2.0.tar.gz.

File metadata

  • Download URL: pywoddle-0.2.0.tar.gz
  • Upload date:
  • Size: 11.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for pywoddle-0.2.0.tar.gz
Algorithm Hash digest
SHA256 9f4e82d4ad7e280ccf7b3b49c6d6f156b8717c73d8ab4cf083d0866302703c9c
MD5 e4187ae947fea3782a71762f039611c8
BLAKE2b-256 06644d5da981cc8991b200a474d1199987edddf7b6cc48125edb4cb5adebe1e5

See more details on using hashes here.

Provenance

The following attestation bundles were made for pywoddle-0.2.0.tar.gz:

Publisher: publish.yml on jlamendo/pywoddle

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

File details

Details for the file pywoddle-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: pywoddle-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 9.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for pywoddle-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 1e19a18c889530a25e38ebc1313271ad521562ea5b6496b1d9ff156f626265b2
MD5 44691f91e0a11bc9cc1df09674dd66cb
BLAKE2b-256 c018e1707df3c709563e41a8317980da93053ca05bd60b58744b0eecf389d5a1

See more details on using hashes here.

Provenance

The following attestation bundles were made for pywoddle-0.2.0-py3-none-any.whl:

Publisher: publish.yml on jlamendo/pywoddle

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