Skip to main content

Save data from Fitbit Takeout to an SQLite database

Project description

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 from 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 /100 which Fitbit have started generating.

$ fitbit-to-sqlite sleep 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.

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

fitbit-to-sqlite-0.5.tar.gz (4.9 kB view details)

Uploaded Source

Built Distributions

fitbit_to_sqlite-0.5-py3.8.egg (9.5 kB view details)

Uploaded Source

fitbit_to_sqlite-0.5-py3-none-any.whl (9.5 kB view details)

Uploaded Python 3

File details

Details for the file fitbit-to-sqlite-0.5.tar.gz.

File metadata

  • Download URL: fitbit-to-sqlite-0.5.tar.gz
  • Upload date:
  • Size: 4.9 kB
  • Tags: Source
  • Uploaded using 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

File hashes

Hashes for fitbit-to-sqlite-0.5.tar.gz
Algorithm Hash digest
SHA256 aed6221cf7cd7c11b6ebca2eae2848fb68698fc56bc393f1154fe869ee3539de
MD5 853d371745226112abb75ecc53d5ddd4
BLAKE2b-256 215ab2c0376730a717841a2ad2cba7e09d3f5e44d40cbe784597d1558c4b3027

See more details on using hashes here.

File details

Details for the file fitbit_to_sqlite-0.5-py3.8.egg.

File metadata

  • Download URL: fitbit_to_sqlite-0.5-py3.8.egg
  • Upload date:
  • Size: 9.5 kB
  • Tags: Source
  • Uploaded using 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

File hashes

Hashes for fitbit_to_sqlite-0.5-py3.8.egg
Algorithm Hash digest
SHA256 e7ea420ccea333c10b75a3cdac0d859660e409a7f4d74fcfb6de9e19c5cb1be7
MD5 9c562827bf5865577d83a3562aa64606
BLAKE2b-256 ca7669c3c80c287d95b6a6f84efdc6ca21f17c470715e573c12d2e335499107c

See more details on using hashes here.

File details

Details for the file fitbit_to_sqlite-0.5-py3-none-any.whl.

File metadata

  • Download URL: fitbit_to_sqlite-0.5-py3-none-any.whl
  • Upload date:
  • Size: 9.5 kB
  • Tags: Python 3
  • Uploaded using 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

File hashes

Hashes for fitbit_to_sqlite-0.5-py3-none-any.whl
Algorithm Hash digest
SHA256 9d84c123ddcea46b01d669b7c8bb8125035c6b406ac1993f0aad0af28b54fd22
MD5 48ae187643563a863247e3af1778adc8
BLAKE2b-256 b6de5b62d7218a63e047aa247214e436ad37976169a5bb21119be419d6f80ed9

See more details on using hashes here.

Supported by

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