Skip to main content

python-plantranger

Asynchronous client for the Plant Ranger API, built for the Home Assistant plant_ranger integration.

The client does not manage OAuth tokens itself. Subclass AbstractAuth and implement async_get_access_token() so the caller stays in charge of refreshing:

from aiohttp import ClientSession
from plantranger import AbstractAuth, PlantRangerClient


class MyAuth(AbstractAuth):
    async def async_get_access_token(self) -> str:
        return "..."


async with ClientSession() as session:
    client = PlantRangerClient(MyAuth(session))
    for team in await client.get_teams():
        detail = await client.get_team(team.id)
        for plant in detail.plants:
            print(plant.name, plant.moisture, plant.needs_water)

API

  • get_teams() — teams the token can see
  • get_team(team_id) — a team with plant and bridge summaries
  • get_plant(plant_id) — full plant detail

Errors raise PlantRangerAuthError (401/403), PlantRangerConnectionError (transport) or PlantRangerError (everything else).

Pointing at a local server

Set both environment variables before starting the process that imports the library:

export PLANTRANGER_API_HOST=http://localhost:8080
export PLANTRANGER_WEB_HOST=http://localhost:4000

API_HOST is used for the API, WEB_HOST for the OAuth authorize and token endpoints.

Releasing

Releases publish to PyPI from GitHub Actions when a v* tag is pushed. The workflow refuses to publish if the tag does not match __version__.

  1. Bump __version__ in plantranger/__init__.py and add a section to CHANGELOG.md.
  2. Commit, then tag and push:
git tag v0.1.0
git push origin main v0.1.0

Publishing uses PyPI Trusted Publishing against the pypi GitHub environment, so no API token is stored in the repo.

Metadata

Release files for plantranger 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 plantranger 0.1.0
File Size Uploaded Provenance Actions
plantranger-0.1.0.tar.gz 9.4 kB With provenance Details for plantranger-0.1.0.tar.gz

Built distribution (wheel)

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

Total release size: 20.5 kB

Release files / plantranger-0.1.0.tar.gz

Download URL plantranger-0.1.0.tar.gz
Size 9.4 kB
Tags Source
SHA-256 checksum
How to use checksums
d859c09b7db4017b94c495df5f162ab86f8e607bc4e09c7f5fc5ee3b4af96fab
BLAKE2b-256 checksum
How to use checksums
231630f5fa1fccf391d8e4952e1cd82d5c3d12e878a35bdae1f0b220761ac49c
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 27, 2026.

Transparency log

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

Download URL plantranger-0.1.0-py3-none-any.whl
Size 11.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
fab8a227bf7e9a4bc04609911a7f9c0928188de0d8fa37cc7c2bbc66247b4e06
BLAKE2b-256 checksum
How to use checksums
39e90af3c28d74749f1abf890554479cdb89213cbf1248ed81bbb97723a5d60a
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 27, 2026.

Transparency log

Security for plantranger 0.1.0

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 plantranger-0.1.0.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 Sep 27, 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.1.0 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