diff --git a/README.md b/README.md index f83e6ba..ba312e9 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,7 @@ ](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 +> 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! @@ -25,7 +25,7 @@ Access your Fitbit data directly from your terminal 💻. View 💤 sleep logs, | [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/) | 👷 | +| [Activity](https://dev.fitbit.com/build/reference/web-api/activity/) | ✅ | ## Usage Guide diff --git a/fitbit_cli/__init__.py b/fitbit_cli/__init__.py index c530992..666f59e 100644 --- a/fitbit_cli/__init__.py +++ b/fitbit_cli/__init__.py @@ -3,4 +3,4 @@ fitbit_cli Module """ -__version__ = "1.1.0" +__version__ = "1.2.0" diff --git a/fitbit_cli/cli.py b/fitbit_cli/cli.py index 4a74e2e..159eeb2 100644 --- a/fitbit_cli/cli.py +++ b/fitbit_cli/cli.py @@ -80,6 +80,15 @@ def parse_arguments(): metavar="DATE[,DATE]", help="Show Active Zone Minutes (AZM) Time Series data", ) + group.add_argument( + "-b", + "--breathing-rate", + type=parse_date_range, + nargs="?", + const=(datetime.today().date(), None), + metavar="DATE[,DATE]", + help="Show Breathing Rate Summary data", + ) group.add_argument( "-u", "--show-user-profile", diff --git a/fitbit_cli/formatter.py b/fitbit_cli/formatter.py index d3878e3..e513bbe 100644 --- a/fitbit_cli/formatter.py +++ b/fitbit_cli/formatter.py @@ -145,3 +145,20 @@ def display_azm_time_series(azm_data): ) CONSOLE.print(table) + + +def display_breathing_rate(breathing_rate_data): + """Breathing Rate data formatter""" + + table = Table(title="Breathing Rate Summary 🫁", show_header=True) + + table.add_column("Date :calendar:") + table.add_column("Breaths Per Minute :dash:") + + for br in breathing_rate_data.get("br", []): + table.add_row( + br.get("dateTime", "N/A"), + str(br.get("value", {}).get("breathingRate", "N/A")), + ) + + CONSOLE.print(table) diff --git a/fitbit_cli/main.py b/fitbit_cli/main.py index 06b9a07..84295c0 100644 --- a/fitbit_cli/main.py +++ b/fitbit_cli/main.py @@ -37,3 +37,7 @@ def main(): fmt.display_heart_data(fitbit.get_heart_rate_time_series(*args.heart)) if args.active_zone: fmt.display_azm_time_series(fitbit.get_azm_time_series(*args.active_zone)) + if args.breathing_rate: + fmt.display_breathing_rate( + fitbit.get_breathing_rate_summary(*args.breathing_rate) + ) diff --git a/setup.py b/setup.py index 53a084e..3e3fb0a 100644 --- a/setup.py +++ b/setup.py @@ -29,7 +29,7 @@ project_urls={ "Documentation": "https://github.com/veerendra2/fitbit-cli", }, - keywords=["fitbit", "cli", "python"], + keywords=["fitbit", "fitbit-api", "cli", "python"], license="MIT", classifiers=[ "Development Status :: 5 - Production/Stable",