Skip to main content

herohealth

An unofficial Python client for the Hero Health HeroConnect cloud API. It is based on observed Android behavior and may break when the service changes. Python 3.12–3.14 are supported.

After the package is published, install it with pip install herohealth. Until then, install from a local checkout with python -m pip install ..

Set HERO_USERNAME (or HERO_EMAIL) and HERO_PASSWORD, or HERO_ACCESS_TOKEN / HERO_REFRESH_TOKEN, in your environment. The client caches tokens at ~/.cache/herohealth/tokens.json; pass token_path=Path(...) to choose a different location. Protect this file like a password. Set HERO_ACCOUNT_ID when accessing a specific account. A .env in the current working directory is also loaded; existing environment variables take precedence.

from herohealth import HeroClient

with HeroClient() as hero:
    hero.login()
    print(hero.user.status())
    print(hero.home.doses())
from herohealth import HeroClient

with HeroClient() as hero:
    print(hero.device.last_d2d_config())
    print(hero.meds.config_current())

The client supports the observed authentication and read operations illustrated above. Responses are passed through as received; their schemas are not guaranteed. Other endpoint wrappers are experimental research interfaces, and extracted endpoint names alone do not establish behavior or safety. Mutation methods can affect real medication schedules and devices. The herohealth command offers login, whoami, home, and other commands. Responses and --summary output may contain sensitive health data. Dispense defaults to preflight; a live start requires explicit confirmation. Never retry a dispense whose outcome is unknown without checking the device and account first. Dispense attempts sharing a token-cache directory are serialized, and an interrupted start remains blocked in the local journal. Use the same cache directory for all clients controlling an account; separate machines or directories cannot coordinate. Malformed dose data or contradictory preflight results are rejected rather than treated as eligible.

Requests time out after 60 seconds. Configured API, RTM, and OAuth origins must use HTTPS; cloud requests are restricted to configured origins and redirects are not followed. Login-page redirects are followed only within the configured OAuth origin, and credential submissions and token requests do not follow redirects. The high-level API methods raise RateLimitError on HTTP 429 and do not automatically retry; wait for Retry-After or, if absent or invalid, 15–60 minutes before further requests. The low-level request() method returns the raw response, so callers must check its status themselves. This is independent research and is not affiliated with Hero Health. See research and protocol status, contributing, and the changelog.

Library-specific authentication and dispense errors inherit from HeroError; RateLimitError remains an AuthError. Other HTTP failures from the high-level helpers raise httpx.HTTPStatusError. The low-level request() returns a raw response without checking its status.

Metadata

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

Built distribution (wheel)

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

Total release size: 50.8 kB

Release files / herohealth-0.1.0.tar.gz

Download URL herohealth-0.1.0.tar.gz
Size 23.9 kB
Tags Source
SHA-256 checksum
How to use checksums
44e3d4bc32db211b2ad34c36891ba5cbf11a9d2a1d7e8724389f1ad17500e841
BLAKE2b-256 checksum
How to use checksums
c429780d841f8a327b57b6f1e32e9aab42b057803909ed46e38bda0c31b2148b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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 Nov 30, 2026.

Transparency log

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

Download URL herohealth-0.1.0-py3-none-any.whl
Size 26.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
ff17bd696d870da4c68dff271cc0ec36eb5b5bd6bd4a114e10d6d2f0b551d700
BLAKE2b-256 checksum
How to use checksums
7425fe4fbe1d5092b082000815c426111dfe0b41ec90322cbfa836999cf13d08
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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 Nov 30, 2026.

Transparency log

Security for herohealth 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 herohealth-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 Nov 30, 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.

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