This release is a pre-release and may not be stable for production use.
hevy-unofficial
Unofficial Python client for the Hevy workout API (api.hevyapp.com).
Disclaimer: Not affiliated with Hevy. The API is undocumented and may change. Use at your own risk and respect Hevy's terms of service.
Install
pip install hevy-unofficial
playwright install chromium
Without browser automation (lighter install):
pip install 'hevy-unofficial[core]'
Development install from source:
pip install -e "packages/hevy[dev]"
# CI / headless dev without Playwright:
pip install -e "packages/hevy[dev,core]"
Quick start
Use tokens from a browser session or from POST /login (login requires reCAPTCHA on web):
from hevy_unofficial import HevyClient
with HevyClient(
access_token="YOUR_ACCESS_TOKEN",
refresh_token="YOUR_REFRESH_TOKEN",
) as client:
account = client.users.get_account()
print(account["username"])
routines = client.routines.list()
workouts = client.workouts.list_paged(username=account["username"], limit=10)
Environment variables (optional):
HEVY_BASE_URL— defaulthttps://api.hevyapp.comHEVY_API_KEY— defaultshelobs_hevy_web(web client key)HEVY_PLATFORM— defaultweb
Browser login
Opens hevy.com and reads the auth2.0-token cookie (login if needed):
from hevy_unofficial import CredentialStore, login_via_browser, prompt_client
store = CredentialStore()
tokens, email = login_via_browser(email="you@example.com", store=store)
# prompt_client tries browser login when Playwright + display are available
with prompt_client(store=store) as client:
...
On headless servers (CI, no DISPLAY), browser login is skipped automatically.
Set HEVY_FORCE_BROWSER=1 to override, or use_browser=False for manual tokens.
Credential cache
Tokens can be cached by email and updated automatically after refresh:
from hevy_unofficial import CredentialStore, prompt_client
store = CredentialStore() # ~/.config/hevy-unofficial/credentials.json
with prompt_client(store=store) as client:
...
On first run, browser login is attempted when available; otherwise you enter tokens. Later runs reuse the cache.
API surface
The client mirrors the web app's HTTP API:
| Attribute | Domain |
|---|---|
client.auth |
Login, signup, refresh, logout, passwords |
client.users |
Account, profile, preferences, API keys |
client.routines |
Routines, folders, sync batch, reorder |
client.workouts |
History, comments, likes, metrics, calendar |
client.exercises |
Built-in catalog (cached), custom templates, history |
client.social |
Feed, follow, followers |
client.coach |
Coach invites and trainer program |
client.billing |
Paddle / Stripe subscription helpers |
client.misc |
Webhooks, OAuth, uploads, feedback |
Exercise catalog
Built-in templates are extracted from hevy.com's _app-*.js bundle (not the REST API):
# Cached for 7 days in ~/.config/hevy-unofficial/exercise_catalog.json
exercises = client.exercises.list_catalog()
# Force ETag check / re-download if the bundle changed
exercises = client.exercises.list_catalog(refresh=True)
Offline extraction from a saved JS file:
client.exercises.parse_catalog_from_js("path/to/_app-xxx.js")
Routines example
# List all routines (sync)
data = client.routines.list()
# Create
created = client.routines.create({
"title": "Push Day",
"exercises": [],
"folder_id": None,
"index": 0,
"program_id": None,
"notes": None,
"coach_force_rpe_enabled": False,
})
routine_id = created["routineId"]
# Update
client.routines.update(routine_id, {
"title": "Push Day A",
"exercises": [...],
"folder_id": None,
"index": 0,
"program_id": None,
"notes": None,
"coach_force_rpe_enabled": False,
})
# Delete
client.routines.delete(routine_id)
Publishing to PyPI
Push a version tag (must match version in pyproject.toml):
git tag v0.1.0
git push origin v0.1.0
The pypi.yml workflow runs tests, publishes to PyPI, then deploys docs to
GitHub Pages (docs deploy only runs after PyPI succeeds). Configure PyPI trusted
publishing for workflow pypi.yml or set PYPI_API_TOKEN.
Manual upload:
cd packages/hevy
pip install build twine
python -m build
twine upload dist/*
Tests
cd packages/hevy
pytest
Metadata
Release files for hevy-unofficial 0.0.2a0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| hevy_unofficial-0.0.2a0.tar.gz | 17.8 kB | With provenance | Details for hevy_unofficial-0.0.2a0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| hevy_unofficial-0.0.2a0-py3-none-any.whl | Python 3 | none | any | Details for hevy_unofficial-0.0.2a0-py3-none-any.whl |
Total release size: 44.2 kB
Release files / hevy_unofficial-0.0.2a0.tar.gz
| Download URL | hevy_unofficial-0.0.2a0.tar.gz |
|---|---|
| Size | 17.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
b60dc7fc1c69b282b36c2ef1c98392b8ddb1eccf77f9301f132d0af23a31112e
|
|
BLAKE2b-256 checksum How to use checksums |
9eb991a1d991c8a947f6f1cb79b8de6f12f6d3f1bcc99b7456117d058dee8128
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
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 Jun 3, 2026.
Transparency logRelease files / hevy_unofficial-0.0.2a0-py3-none-any.whl
| Download URL | hevy_unofficial-0.0.2a0-py3-none-any.whl |
|---|---|
| Size | 26.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
ad74adf047afdf1d810fa45f4e48f847a8871e4f6fb123cab62215391b31c117
|
|
BLAKE2b-256 checksum How to use checksums |
a83e754991fd106209802bc69be351420b948e7ae56366a4b96809de31fae8a0
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
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 Jun 3, 2026.
Transparency logSecurity for hevy-unofficial 0.0.2a0
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.
Attestation for hevy_unofficial-0.0.2a0.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 Jun 3, 2026.
Transparency logA 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.