A Django app to access Fitbit Web APIs.
Project description
django-fitbit-healthkit
django-fitbit-healthkit is a Django Fitbit App with HealthKit-friendly API. The goal is to provide a wrapper over fitbit authentication, token management, and web APIs that is similar to other high-level healthkit wrappers like react-native-healthkit. The HealthKit API from Apple is here for reference.
A sample app is included in the sample
directory to showcase how to use the fitbit app.
Detailed documentation is in the "docs" directory.
Quick start
- Add "fitbit" to your INSTALLED_APPS setting like this:
INSTALLED_APPS = [
...,
"django_fitbit_healthkit",
]
- Include the fitbit URLconf in your project urls.py like this:
path("fitbit/", include("django_fitbit_healthkit.urls")),
-
Run
python manage.py migrate
to create the models. -
Visit the
/fitbit/login
URL to sign in with Fitbit.
Running the sample app
Make sure to set environment variables for
FITBIT_CLIENT_ID=xxx
FITBIT_CLIENT_SECRET=xxx
which will be picked up by sample/settings.py
.
In your fitbit app settings, add http://localhost:8000/fitbit/success
to the allowed callback URLs.
Set up dev environment. There is nothing complicated here, so vanilla venv on any platform is probably sufficient (no nix/devbox, dev container type setup is necessary).
python3 -m venv venv
source venv/bin/activate
pip3 install Django
Apply DB migrations with python3 manage.py migrate
.
You can run the app quite simply:
python3 manage.py runserver
This will allow you to register an account, sign in with fitbit, and view some of your data.
Release workflow
Develop on a branch. When it's ready, merge to main.
If this is not a release (no bumped version in setup.cfg
),
then TestPyPI may fail
with a duplicate sdist upload (it has before).
If it's a new version, then the setup.cfg
should have been bumped on the branch.
When it's merged,
we expect TestPyPI to succeed.
Then the tag can be pushed to GH,
which will trigger real PyPI release.
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
Built Distribution
File details
Details for the file django_fitbit_healthkit-0.6.tar.gz
.
File metadata
- Download URL: django_fitbit_healthkit-0.6.tar.gz
- Upload date:
- Size: 16.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.1.0 CPython/3.12.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1aee98c7016dfb296d8b7ff9d0ebc53697fc6ef33f19c9f1114d0943142fbf96 |
|
MD5 | 775a4d16429d27ec7f93d097949e4029 |
|
BLAKE2b-256 | 9dbe90bf68bbe1c00d0b68e83da8756ce9c6c9afd162dec655119bc674414fd7 |
File details
Details for the file django_fitbit_healthkit-0.6-py3-none-any.whl
.
File metadata
- Download URL: django_fitbit_healthkit-0.6-py3-none-any.whl
- Upload date:
- Size: 19.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.1.0 CPython/3.12.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1d8a395ba4a89c64a348ec781405934197579db38ed04dc17ee2f496b71c8947 |
|
MD5 | 2d91ff3025e4ddbf1b6bbbf512c377cd |
|
BLAKE2b-256 | 76c932f80a75c27b17712dd939ae020e2964e021f1e3b16292ade40838aaebb7 |