biostream
Collect your Amazfit/Zepp strap (directly over Bluetooth) and your Oura Ring (cloud), store it locally, and serve everything over GraphQL — including a live heart-rate subscription. One pip install, one call.
Install
pip install biostream
Quickstart
from biostream import serve
# you already have your 16-byte strap key + Oura token:
serve(auth_key="0x<32-hex-chars>", oura_token="<OURA_PAT>")
This starts the background collector and the GraphQL gateway in one process. Open the playground at http://127.0.0.1:8000/graphql.
Don't have the strap key yet? Let biostream fetch it by logging into your Zepp account:
serve(zepp_email="you@example.com", zepp_password="••••", oura_token="<OURA_PAT>")
CLI
biostream serve --auth-key 0x.. --oura-token .. # collect + serve
biostream scan # find your strap's BLE name
biostream fetch-key --email .. --password .. # get the 16-byte auth key via a Zepp login
Env vars also work: ZEPP_AUTH_KEY / AUTH_KEY, OURA_TOKEN, STRAP_NAME, DATA_DIR, HOST,
PORT, ZEPP_EMAIL / ZEPP_PASSWORD.
Query it
{
live { connected hr battery steps today { restingHr sleepMinutes } }
heartRate(limit: 50) { ts bpm }
oura { nights { day totalH hrv restingHr } readiness { day score } }
insights { nNights recovery }
}
Live stream (WebSocket subscription):
subscription { heartRateLive { ts bpm } }
Time-series accept start / end (epoch ms) and limit (default 500, max 50000).
What you get
- Strap (BLE): live HR + steps + battery, plus historical activity, resting/max HR, SpO₂, stress, PAI.
- Oura (cloud): sleep stages, HRV, resting HR, SpO₂, readiness, daily activity, intraday HR.
- Insights: a validated Recovery Score, FDR-corrected correlations and trends (improves as the strap accumulates a few days of data).
- GraphQL gateway: read-only, localhost-only, with a GraphiQL playground and a live-HR subscription.
How it works
Components talk only through a local data dir (~/.local/share/biostream by default):
worker (collects) → data/ (SQLite + JSON) → api (GraphQL). An authenticator owns all
credentials; nothing else reads your keys.
from biostream import Config, run_worker, create_app
# advanced: run the collector and the API separately, or host create_app(config) under your own ASGI server
Notes
- The strap must be free (not connected to the phone's Zepp app) while biostream runs — turn off phone Bluetooth.
- The gateway is open but localhost-only. Don't bind it to a public interface: it serves personal health data with no auth.
- Getting the strap key requires a one-time Zepp login (
fetch-key). Unpairing the strap in the Zepp app invalidates the key.
MIT licensed. Built by reverse-engineering the Huami-2021 / Zepp OS BLE protocol; not affiliated with Amazfit, Zepp, or Oura.
Metadata
Release files for biostream 0.0.1
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 |
|---|---|---|---|---|
| biostream-0.0.1.tar.gz | 31.9 kB | Without provenance | Details for biostream-0.0.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| biostream-0.0.1-py3-none-any.whl | Python 3 | none | any | Details for biostream-0.0.1-py3-none-any.whl |
Total release size: 70.4 kB
Release files / biostream-0.0.1.tar.gz
| Download URL | biostream-0.0.1.tar.gz |
|---|---|
| Size | 31.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
96384275f7c488d808409727dc5221ffd355e234361b9139d3c88728e068a995
|
|
BLAKE2b-256 checksum How to use checksums |
b78b06a4dea9d985b1a0706cb364bcbb64a58ad6f6c109ac7cde70bc4ac8d534
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.12.7
|
Release files / biostream-0.0.1-py3-none-any.whl
| Download URL | biostream-0.0.1-py3-none-any.whl |
|---|---|
| Size | 38.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
a9afa15af91c02d1069b6a46a58db5578eafced9673eaccbbcc9c463adcadafd
|
|
BLAKE2b-256 checksum How to use checksums |
e50ea14102e8524b420f4d24eb28333f5365dac645fb60be4039ab90636c0005
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.12.7
|
Security for biostream 0.0.1
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.
No provenance found
None of the files in this release were uploaded with provenance metadata.
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.