Skip to main content

fitbit-to-sqlite

PyPI License

Save data from Fitbit Takeout to an SQLite database.

How to install

$ pip install fitbit-to-sqlite

Request your Fitbit data from the Export Your Account Archive section on this page https://www.fitbit.com/settings/data/export - wait for the email and download the zip file.

This tool only supports a subset of the available data sources. More will be added over time.

Resting Heart Rate

You can import data on your resting heart rate over time by using this command:

$ fitbit-to-sqlite resting-heart-rate fitbit.db MyFitbitData.zip

This will create a database file called fitbit.db if one does not already exist.

Distance

You can import data on the distance you have travelled each minute of each day by using the following command. Note that this also creates an analysis view called distance_v which converts the distances to km and miles.

$ fitbit-to-sqlite distance fitbit.db MyFitbitData.zip

Minutes Active

You can import data on your activity minutes, which Fitbit classifies into Sedentary, Lightly Active, Moderately Active and Very Active using the following command. Note that this creates separate database tables for each, but they are also combined together into a view for analysis called minutes_active_v.

$ fitbit-to-sqlite minutes-active fitbit.db MyFitbitData.zip

Exercise

You can import data on your exercise activities using the following command. Note that this imports a subset of all fields.

$ fitbit-to-sqlite exercise fitbit.db MyFitbitData.zip

Sleep

You can import sleep log data using the following command. Note that some fields are only populated for sleep captured in stages. A second table called sleep_scores is also created which includes the scores (out of 100) which Fitbit have started generating.

$ fitbit-to-sqlite sleep fitbit.db MyFitbitData.zip

Heart Rate Zones

You can import data on the time you have spent across the four heart rate zones which Fitbit defines based on your maximum heart rate. In the app these are usually referred to as "Below Zones", "Fat Burn", "Cardio" and "Peak" but here they are imported as below_zone_1, in_zone_1, in_zone_2 and in_zone_3.

$ fitbit-to-sqlite heart-rate-zones fitbit.db MyFitbitData.zip

Browsing your data with Datasette

Once you have imported Fitbit data into an SQLite database file you can browse your data using Datasette. Install Datasette like so:

$ pip install datasette

Now browse your data by running this and then visiting http://localhost:8001/

$ datasette fitbit.db

Thanks

This package is heavily inspired by the interesting work on Personal Analytics which Simon Willison has been doing here.

Metadata

Release files for fitbit-to-sqlite 0.6

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for fitbit-to-sqlite 0.6
File Size Uploaded
fitbit-to-sqlite-0.6.tar.gz 5.6 kB Details

Built distributions (wheels)

Table of built distributions (wheels) for fitbit-to-sqlite 0.6
File Interpreter ABI Platform
fitbit_to_sqlite-0.6-py3.8.egg Legacy Egg format - - Details
fitbit_to_sqlite-0.6-py3-none-any.whl Python 3 none any Details

Total release size: 25.9 kB

Release files / fitbit-to-sqlite-0.6.tar.gz

Download URL fitbit-to-sqlite-0.6.tar.gz
Size 5.6 kB
Tags Source
SHA-256 checksum
How to use checksums
0da02adf44d4e219755622b7a3e70878670035d1c40e7ebd166e6b2dc5675fa7
BLAKE2b-256 checksum
How to use checksums
0e54e549d82b0e09593fcffa087f5743b91e28b2f4458d796ae626c692dbb6e4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/49.6.0.post20200814 requests-toolbelt/0.9.1 tqdm/4.48.2 CPython/3.8.5

Release files / fitbit_to_sqlite-0.6-py3.8.egg

Download URL fitbit_to_sqlite-0.6-py3.8.egg
Size 10.3 kB
Tags Egg
SHA-256 checksum
How to use checksums
59e85ee3aa3534f42008275a690415709140732d5e0c6b489f86cd8cf2aa2eae
BLAKE2b-256 checksum
How to use checksums
906820d51df45633c1bc09ef6e38c7a485edaafad2bc3302894caf79ecdece69
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/49.6.0.post20200814 requests-toolbelt/0.9.1 tqdm/4.48.2 CPython/3.8.5

Release files / fitbit_to_sqlite-0.6-py3-none-any.whl

Download URL fitbit_to_sqlite-0.6-py3-none-any.whl
Size 9.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
452b0d7ff3fc0d4fe0542ef876b4593f19e55eabc4f16461cef2c2045a04ff45
BLAKE2b-256 checksum
How to use checksums
a076e767d56bc6568e67a24b4e93d0b78fffd5c4b993bc259a4454b595e6a14c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/49.6.0.post20200814 requests-toolbelt/0.9.1 tqdm/4.48.2 CPython/3.8.5

Release history Release notifications | RSS feed

This release

0.6 This release

3 release files

0.5

3 release files

0.4

3 release files

0.3

3 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page