A Django app for the Google Health API (successor to the Fitbit Web API), backed by django-healthdatamodel.
Project description
django-google-health
A reusable Django app for the Google Health API — the successor to the Fitbit Web API. Handles the Google OAuth 2.0 flow, fetches user health data from health.googleapis.com, and persists it through django-healthdatamodel so the same storage and query layer serves Apple Health, Fitbit, and Google Health side-by-side.
Google recommends launching new integrations after the end of May 2026 to align with legacy Fitbit account deprecation. See
docs/google-health/get-started.md.
Status
Early scaffolding. The package, demo project, OAuth model, and CI are in place. OAuth views, the HTTP client, ingest mapping, and webhook handling are stubbed and will land in follow-up slices.
Install
pip install django-google-health
Add both this app and django-healthdatamodel to INSTALLED_APPS, then run migrations:
INSTALLED_APPS = [
...
"healthdatamodel",
"googlehealth",
]
python manage.py migrate
The model uses settings.AUTH_USER_MODEL so it works with any custom user model.
Configuration
GOOGLE_HEALTH_CLIENT_ID = "..." # from Google Cloud Console
GOOGLE_HEALTH_CLIENT_SECRET = "..."
GOOGLE_HEALTH_REDIRECT_URI = "https://your-app.example.com/google-health/callback"
Set up the OAuth client in Google Cloud Console and enable the Google Health API. See docs/google-health/codelabs-make-your-first-api-call.md for a step-by-step walkthrough.
Scopes
Google Health scopes are namespaced under https://www.googleapis.com/auth/googlehealth.*. The complete list lives in googlehealth.constants and is documented in docs/google-health/scopes.md. Examples:
googlehealth.activity_and_fitness.readonly— steps, distance, exercise, floors, altitudegooglehealth.health_metrics_and_measurements.readonly— heart rate, weight, body fat, SpO2googlehealth.sleep.readonly— sleep stages and sessionsgooglehealth.location.readonly— exercise GPS
Storage
This app does not define Record / Workout tables — those live in django-healthdatamodel. The googlehealth.ingest module maps Google Health API responses to healthdatamodel.schemas.RecordInput and WorkoutInput, then calls healthdatamodel.ingest.ingest_records to persist them. Read the data back with healthdatamodel.query.* (see that project's docs).
The only model defined here is GoogleHealthConnection: per-user OAuth tokens, granted scopes, connection status, and last sync timestamp.
Documentation
The Google Health API documentation is vendored as Markdown under docs/google-health/ so it's grep-able offline:
get-started.md— overview, benefits, getting started pathsmigration.md— Fitbit Web API → Google Health API migration guidedata-types.md— every data type with operations and scopesscopes.md— OAuth scopeswebhooks.md— subscriber registration, endpoint verification, notification payloadscodelabs-make-your-first-api-call.md— end-to-end OAuth + first API callreference-rest.md— REST resource indexmigration-parity-tool.md— parity tool referencesupport.md— issue tracker and forum links
Demo project
The repo includes a runnable demo Django project under demo/:
uv sync
uv run python manage.py migrate
uv run python manage.py createsuperuser
uv run python manage.py runserver
Visit http://localhost:8000/admin/ to browse the googlehealth and healthdatamodel apps.
Development
uv sync --group dev
uv run pytest tests/ -v
uv run pre-commit run --all-files
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file django_google_health-0.0.1.tar.gz.
File metadata
- Download URL: django_google_health-0.0.1.tar.gz
- Upload date:
- Size: 55.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
11fec738513a63458297111468cef56af3f9c7d7878bf5a25aa00ccfd4cff4e9
|
|
| MD5 |
da463cc9fd2135e5070992810bc12f7c
|
|
| BLAKE2b-256 |
43ddb2df82ae17eed594242b5d241a724c51e096c2c900d52ac9622e6747375a
|
Provenance
The following attestation bundles were made for django_google_health-0.0.1.tar.gz:
Publisher:
ci.yml on andyreagan/django-google-health
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
django_google_health-0.0.1.tar.gz -
Subject digest:
11fec738513a63458297111468cef56af3f9c7d7878bf5a25aa00ccfd4cff4e9 - Sigstore transparency entry: 1540179917
- Sigstore integration time:
-
Permalink:
andyreagan/django-google-health@2d8900adfdc2a723795c2b5f48ee6781eb1bfb94 -
Branch / Tag:
refs/tags/v0.0.1 - Owner: https://github.com/andyreagan
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
ci.yml@2d8900adfdc2a723795c2b5f48ee6781eb1bfb94 -
Trigger Event:
push
-
Statement type:
File details
Details for the file django_google_health-0.0.1-py3-none-any.whl.
File metadata
- Download URL: django_google_health-0.0.1-py3-none-any.whl
- Upload date:
- Size: 8.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b24c54e1f1d5e3beee95be2b2313bd2e953456aafd9d58bc10b1f54ed9380fb6
|
|
| MD5 |
43b13d7618baad5af97d0989d46aaac8
|
|
| BLAKE2b-256 |
99fca776839fae1fd143848dcf961fcdddbb43bf1b07148702dfd98459845446
|
Provenance
The following attestation bundles were made for django_google_health-0.0.1-py3-none-any.whl:
Publisher:
ci.yml on andyreagan/django-google-health
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
django_google_health-0.0.1-py3-none-any.whl -
Subject digest:
b24c54e1f1d5e3beee95be2b2313bd2e953456aafd9d58bc10b1f54ed9380fb6 - Sigstore transparency entry: 1540180444
- Sigstore integration time:
-
Permalink:
andyreagan/django-google-health@2d8900adfdc2a723795c2b5f48ee6781eb1bfb94 -
Branch / Tag:
refs/tags/v0.0.1 - Owner: https://github.com/andyreagan
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
ci.yml@2d8900adfdc2a723795c2b5f48ee6781eb1bfb94 -
Trigger Event:
push
-
Statement type: