Skip to main content

Collect Amazfit/Zepp strap (BLE) + Oura cloud health data and serve it over GraphQL.

Project description

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.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

biostream-0.0.1.tar.gz (31.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

biostream-0.0.1-py3-none-any.whl (38.5 kB view details)

Uploaded Python 3

File details

Details for the file biostream-0.0.1.tar.gz.

File metadata

  • Download URL: biostream-0.0.1.tar.gz
  • Upload date:
  • Size: 31.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.7

File hashes

Hashes for biostream-0.0.1.tar.gz
Algorithm Hash digest
SHA256 96384275f7c488d808409727dc5221ffd355e234361b9139d3c88728e068a995
MD5 187dba49868e36e630ba0bed699fd2dc
BLAKE2b-256 b78b06a4dea9d985b1a0706cb364bcbb64a58ad6f6c109ac7cde70bc4ac8d534

See more details on using hashes here.

File details

Details for the file biostream-0.0.1-py3-none-any.whl.

File metadata

  • Download URL: biostream-0.0.1-py3-none-any.whl
  • Upload date:
  • Size: 38.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.7

File hashes

Hashes for biostream-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 a9afa15af91c02d1069b6a46a58db5578eafced9673eaccbbcc9c463adcadafd
MD5 9b9d31c328069b8330aa90b3d1ef8ba9
BLAKE2b-256 e50ea14102e8524b420f4d24eb28333f5365dac645fb60be4039ab90636c0005

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page