fitbit-cli


Namefitbit-cli JSON
Version 1.1.0 PyPI version JSON
download
home_pagehttps://github.com/veerendra2/fitbit-cli
SummaryAccess your Fitbit data at your terminal.
upload_time2024-12-25 20:41:25
maintainerNone
docs_urlNone
authorveerendra2
requires_python>=3.9
licenseMIT
keywords fitbit cli python
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # Fitbit CLI

[![Release](https://github.com/veerendra2/fitbit-cli/actions/workflows/release.yml/badge.svg)](https://github.com/veerendra2/fitbit-cli/actions/workflows/release.yml) [![PyPI - Status](https://img.shields.io/pypi/status/fitbit-cli)
](https://pypi.org/project/fitbit-cli/) [![PyPI - Version](https://img.shields.io/pypi/v/fitbit-cli)
](https://pypi.org/project/fitbit-cli/)

> โš ๏ธ This is not an official Fitbit CLI

Access your Fitbit data directly from your terminal ๐Ÿ’ป. View ๐Ÿ’ค sleep logs, โค๏ธ heart rate, ๐Ÿ‹๏ธโ€โ™‚๏ธ activity levels, ๐Ÿฉธ SpO2, and more, all presented in a simple, easy-to-read table format!

<p align="center">
  <img alt="Fitbit logo", width="250" src="https://raw.githubusercontent.com/veerendra2/fitbit-cli/refs/heads/main/assets/Fitbit_Logo_White_RGB.jpg">
</p>

[![asciicast](https://asciinema.org/a/696114.svg)](https://asciinema.org/a/696114)

## Supported Web APIs

> Only `GET` APIs are supported!

| API                                                                                                                     | Status |
| ----------------------------------------------------------------------------------------------------------------------- | ------ |
| [User](https://dev.fitbit.com/build/reference/web-api/user/)                                                            | โœ…     |
| [Sleep](https://dev.fitbit.com/build/reference/web-api/sleep/)                                                          | โœ…     |
| [SpO2](https://dev.fitbit.com/build/reference/web-api/spo2/)                                                            | โœ…     |
| [Heart Rate Time Series](https://dev.fitbit.com/build/reference/web-api/heartrate-timeseries/)                          | โœ…     |
| [Active Zone Minutes (AZM) Time Series](https://dev.fitbit.com/build/reference/web-api/active-zone-minutes-timeseries/) | โœ…     |
| [Activity](https://dev.fitbit.com/build/reference/web-api/activity/)                                                    | ๐Ÿ‘ท     |

## Usage Guide

1. Install the Fitbit CLI

```bash
python -m pip install fitbit-cli
```

2. Help

```bash
fitbit-cli -h
usage: fitbit-cli [-h] [-i] [-s [DATE[,DATE]]] [-o [DATE[,DATE]]] [-e [DATE[,DATE]]] [-a [DATE[,DATE]]] [-u] [-v]

Fitbit CLI -- Access your Fitbit data at your terminal.

options:
  -h, --help            show this help message and exit
  -i, --init-auth       Initialize Fitbit iterative authentication setup
  -v, --version         Show fitbit-cli version

APIs:
  Specify date ranges (ISO 8601 format: YYYY-MM-DD) for the following arguments.
  You can provide a single date or a range (start,end). If not provided, defaults to today's date.

  -s, --sleep [DATE[,DATE]]
                        Show sleep data
  -o, --spo2 [DATE[,DATE]]
                        Show SpO2 data
  -e, --heart [DATE[,DATE]]
                        Show Heart Rate Time Series data
  -a, --active-zone [DATE[,DATE]]
                        Show Active Zone Minutes (AZM) Time Series data
  -u, --show-user-profile
                        Show user profile data
```

3. Register Fitbit App

   1. Go to [https://dev.fitbit.com/apps](https://dev.fitbit.com/apps)
   2. Click on "REGISTER AN APP" tab
   3. Follow below example and register an app

     <p align="left">
       <img alt="Fitbit logo", width="700" src="https://raw.githubusercontent.com/veerendra2/fitbit-cli/refs/heads/main/assets/fitbit-app-registration.png">
     </p>

4. Run the following command to set up interactive authentication and store the Fitbit token locally

   ```bash
    fitbit-cli --init-auth
   ```

   For a visual guide, see the Asciinema recording below
   [![asciicast](https://asciinema.org/a/696115.svg)](https://asciinema.org/a/696115)

5. Start using it ๐Ÿ˜Ž

```bash
$ fitbit-cli -s
                                   Sleep Data Summary ๐Ÿ˜ด
โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”ณโ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”ณโ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”ณโ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”ณโ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”ณโ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”“
โ”ƒ Date ๐Ÿ“†    โ”ƒ Deep Sleep ๐Ÿ› โ”ƒ Light Sleep ๐Ÿ’ค โ”ƒ REM Sleep ๐ŸŒ™ โ”ƒ Wake Time โฐ โ”ƒ Efficiency ๐Ÿ’ฏ โ”ƒ
โ”กโ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ•‡โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ•‡โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ•‡โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ•‡โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ•‡โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”ฉ
โ”‚ 2024-12-25 โ”‚ 139 min      โ”‚ 190 min        โ”‚ 155 min      โ”‚ 54 min       โ”‚ 55%           โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
```

_**NOTE: The token is valid for only 8 hours, `fitbit-cli` automatically refreshes the token when it expires.**_

## Local Development

- [Fitbit Docs](https://dev.fitbit.com/build/reference/web-api/)
- [OAuth Tutorial](https://dev.fitbit.com/build/reference/web-api/troubleshooting-guide/oauth2-tutorial/)

```bash
git clone git@github.com:veerendra2/fitbit-cli.git
cd fitbit-cli

python -m venv venv
source venv/bin/activate
python -m pip install -e .
```

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/veerendra2/fitbit-cli",
    "name": "fitbit-cli",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.9",
    "maintainer_email": null,
    "keywords": "fitbit, cli, python",
    "author": "veerendra2",
    "author_email": "vk.tyk23@simplelogin.com",
    "download_url": "https://files.pythonhosted.org/packages/12/8a/6e0adeed3248a45938aa8bec3c49eaca7ee9467f0aeb1d9c14a69349bf9c/fitbit_cli-1.1.0.tar.gz",
    "platform": null,
    "description": "# Fitbit CLI\n\n[![Release](https://github.com/veerendra2/fitbit-cli/actions/workflows/release.yml/badge.svg)](https://github.com/veerendra2/fitbit-cli/actions/workflows/release.yml) [![PyPI - Status](https://img.shields.io/pypi/status/fitbit-cli)\n](https://pypi.org/project/fitbit-cli/) [![PyPI - Version](https://img.shields.io/pypi/v/fitbit-cli)\n](https://pypi.org/project/fitbit-cli/)\n\n> \u26a0\ufe0f This is not an official Fitbit CLI\n\nAccess your Fitbit data directly from your terminal \ud83d\udcbb. View \ud83d\udca4 sleep logs, \u2764\ufe0f heart rate, \ud83c\udfcb\ufe0f\u200d\u2642\ufe0f activity levels, \ud83e\ude78 SpO2, and more, all presented in a simple, easy-to-read table format!\n\n<p align=\"center\">\n  <img alt=\"Fitbit logo\", width=\"250\" src=\"https://raw.githubusercontent.com/veerendra2/fitbit-cli/refs/heads/main/assets/Fitbit_Logo_White_RGB.jpg\">\n</p>\n\n[![asciicast](https://asciinema.org/a/696114.svg)](https://asciinema.org/a/696114)\n\n## Supported Web APIs\n\n> Only `GET` APIs are supported!\n\n| API                                                                                                                     | Status |\n| ----------------------------------------------------------------------------------------------------------------------- | ------ |\n| [User](https://dev.fitbit.com/build/reference/web-api/user/)                                                            | \u2705     |\n| [Sleep](https://dev.fitbit.com/build/reference/web-api/sleep/)                                                          | \u2705     |\n| [SpO2](https://dev.fitbit.com/build/reference/web-api/spo2/)                                                            | \u2705     |\n| [Heart Rate Time Series](https://dev.fitbit.com/build/reference/web-api/heartrate-timeseries/)                          | \u2705     |\n| [Active Zone Minutes (AZM) Time Series](https://dev.fitbit.com/build/reference/web-api/active-zone-minutes-timeseries/) | \u2705     |\n| [Activity](https://dev.fitbit.com/build/reference/web-api/activity/)                                                    | \ud83d\udc77     |\n\n## Usage Guide\n\n1. Install the Fitbit CLI\n\n```bash\npython -m pip install fitbit-cli\n```\n\n2. Help\n\n```bash\nfitbit-cli -h\nusage: fitbit-cli [-h] [-i] [-s [DATE[,DATE]]] [-o [DATE[,DATE]]] [-e [DATE[,DATE]]] [-a [DATE[,DATE]]] [-u] [-v]\n\nFitbit CLI -- Access your Fitbit data at your terminal.\n\noptions:\n  -h, --help            show this help message and exit\n  -i, --init-auth       Initialize Fitbit iterative authentication setup\n  -v, --version         Show fitbit-cli version\n\nAPIs:\n  Specify date ranges (ISO 8601 format: YYYY-MM-DD) for the following arguments.\n  You can provide a single date or a range (start,end). If not provided, defaults to today's date.\n\n  -s, --sleep [DATE[,DATE]]\n                        Show sleep data\n  -o, --spo2 [DATE[,DATE]]\n                        Show SpO2 data\n  -e, --heart [DATE[,DATE]]\n                        Show Heart Rate Time Series data\n  -a, --active-zone [DATE[,DATE]]\n                        Show Active Zone Minutes (AZM) Time Series data\n  -u, --show-user-profile\n                        Show user profile data\n```\n\n3. Register Fitbit App\n\n   1. Go to [https://dev.fitbit.com/apps](https://dev.fitbit.com/apps)\n   2. Click on \"REGISTER AN APP\" tab\n   3. Follow below example and register an app\n\n     <p align=\"left\">\n       <img alt=\"Fitbit logo\", width=\"700\" src=\"https://raw.githubusercontent.com/veerendra2/fitbit-cli/refs/heads/main/assets/fitbit-app-registration.png\">\n     </p>\n\n4. Run the following command to set up interactive authentication and store the Fitbit token locally\n\n   ```bash\n    fitbit-cli --init-auth\n   ```\n\n   For a visual guide, see the Asciinema recording below\n   [![asciicast](https://asciinema.org/a/696115.svg)](https://asciinema.org/a/696115)\n\n5. Start using it \ud83d\ude0e\n\n```bash\n$ fitbit-cli -s\n                                   Sleep Data Summary \ud83d\ude34\n\u250f\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2533\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2533\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2533\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2533\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2533\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2513\n\u2503 Date \ud83d\udcc6    \u2503 Deep Sleep \ud83d\udecf \u2503 Light Sleep \ud83d\udca4 \u2503 REM Sleep \ud83c\udf19 \u2503 Wake Time \u23f0 \u2503 Efficiency \ud83d\udcaf \u2503\n\u2521\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2547\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2547\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2547\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2547\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2547\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2529\n\u2502 2024-12-25 \u2502 139 min      \u2502 190 min        \u2502 155 min      \u2502 54 min       \u2502 55%           \u2502\n\u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2534\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2534\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2534\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2534\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2534\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2518\n```\n\n_**NOTE: The token is valid for only 8 hours, `fitbit-cli` automatically refreshes the token when it expires.**_\n\n## Local Development\n\n- [Fitbit Docs](https://dev.fitbit.com/build/reference/web-api/)\n- [OAuth Tutorial](https://dev.fitbit.com/build/reference/web-api/troubleshooting-guide/oauth2-tutorial/)\n\n```bash\ngit clone git@github.com:veerendra2/fitbit-cli.git\ncd fitbit-cli\n\npython -m venv venv\nsource venv/bin/activate\npython -m pip install -e .\n```\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "Access your Fitbit data at your terminal.",
    "version": "1.1.0",
    "project_urls": {
        "Documentation": "https://github.com/veerendra2/fitbit-cli",
        "Download": "https://github.com/veerendra2/fitbit-cli/archive/1.1.0.tar.gz",
        "Homepage": "https://github.com/veerendra2/fitbit-cli"
    },
    "split_keywords": [
        "fitbit",
        " cli",
        " python"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "128a6e0adeed3248a45938aa8bec3c49eaca7ee9467f0aeb1d9c14a69349bf9c",
                "md5": "f8c5187405471f774e0cac0a9e5f8612",
                "sha256": "26ff4fe50a846d21060239323fb22062a47e37fde1a19283435c9895209df265"
            },
            "downloads": -1,
            "filename": "fitbit_cli-1.1.0.tar.gz",
            "has_sig": false,
            "md5_digest": "f8c5187405471f774e0cac0a9e5f8612",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.9",
            "size": 12036,
            "upload_time": "2024-12-25T20:41:25",
            "upload_time_iso_8601": "2024-12-25T20:41:25.020283Z",
            "url": "https://files.pythonhosted.org/packages/12/8a/6e0adeed3248a45938aa8bec3c49eaca7ee9467f0aeb1d9c14a69349bf9c/fitbit_cli-1.1.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-12-25 20:41:25",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "veerendra2",
    "github_project": "fitbit-cli",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "fitbit-cli"
}
        
Elapsed time: 0.40733s