Skip to main content

pywillow

Async Python client for the Willow plant sensor API.

Installation

pip install pywillow

Usage

import aiohttp
from pywillow import WillowClient

async def main():
    async with aiohttp.ClientSession() as session:
        client = WillowClient(session, access_token="your-oauth2-token")

        # Get the authenticated user's profile
        profile = await client.get_profile()
        print(profile["username"])

        # Get paired sensor devices
        devices = await client.get_devices()
        for device in devices:
            print(device["sensor_id"], device["user_plant"]["name"])

API

WillowClient(session, token, *, base_url=None)

  • update_token(token) — Update the access token (e.g. after an OAuth2 refresh).
  • get_profile() → WillowProfile — Fetch the authenticated user's profile.
  • get_devices() → list[WillowDevice] — Fetch the user's paired sensor devices.

Models

All models are TypedDict subclasses representing the JSON responses from the Willow API:

  • WillowProfile — id, username, profile_image
  • WillowDevice — id, sensor_id, battery_life, version, user_plant, latest_reading, profile_image (optional)
  • WillowUserPlant — id, name, location
  • WillowReading — timestamp, temperature, humidity, moisture, light

Exceptions

  • WillowError — Base exception for all Willow API errors.
  • WillowAuthError — Raised on 401/403 responses (authentication failed).
  • WillowApiError — Raised on other HTTP errors. Includes a status attribute.

Development

# Install with dev dependencies
uv sync

# Run tests
uv run pytest

# Build the package
uv build

License

MIT

Metadata

Release files for pywillow 0.1.0

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

Source distribution (sdist)

Source distribution for pywillow 0.1.0
File Size Uploaded
pywillow-0.1.0.tar.gz 71.8 kB Details

Built distribution (wheel)

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

Total release size: 77.1 kB

Release files / pywillow-0.1.0.tar.gz

Download URL pywillow-0.1.0.tar.gz
Size 71.8 kB
Tags Source
SHA-256 checksum
How to use checksums
a77f59f80aa6410b9329fb17c75c57b922c04b13430edc6db0c87d7027a16bed
BLAKE2b-256 checksum
How to use checksums
d99b78900ec40d14324ff30e687495a4a630799bdd55c03565a46fced711ee21
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.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 Jul 28, 2026.

Transparency log

Release files / pywillow-0.1.0-py3-none-any.whl

Download URL pywillow-0.1.0-py3-none-any.whl
Size 5.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
945fa47b116ef66ef7bac017110c12f65522af0dde2be893e810975f01c21353
BLAKE2b-256 checksum
How to use checksums
a9c5bb521ec9bc32a95771de6b8719d82b8330caa3e9598f07fa3e1ec694ca76
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.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 Jul 28, 2026.

Transparency log

Release history Release notifications | RSS feed

0.1.2

2 release files

This release

0.1.0 This release

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