add -hrv parameters to fetch HRV data#29
Conversation
There was a problem hiding this comment.
Pull request overview
Adds HRV (Heart Rate Variability) support to fitbit-cli, enabling users to fetch and display HRV summary data from the Fitbit Web API in table, JSON, and raw-JSON output modes.
Changes:
- Introduces a new
--hrv [DATE[,DATE]|RELATIVE]CLI flag wired through all output modes. - Adds Fitbit API client support for HRV summary fetching.
- Adds an HRV formatter and CLI parsing tests, plus accompanying design/plan docs.
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| tests/cli_test.py | Adds parsing tests covering --hrv alone, with JSON/raw-JSON, and with several date formats. |
| fitbit_cli/output.py | Plumbs args.hrv into table_display, json_display, and raw_json_display. |
| fitbit_cli/formatter.py | Adds display_hrv() to render HRV data as a rich table or snake_case JSON structure. |
| fitbit_cli/fitbit_api.py | Adds get_hrv_summary() (and an intraday variant) to call the HRV endpoint(s). |
| fitbit_cli/cli.py | Adds the --hrv flag using the shared parse_date_range mechanism and default-to-today behavior. |
| docs/superpowers/specs/2026-03-31-hrv-support-design.md | Design doc describing endpoints, response shape, and implementation approach. |
| docs/superpowers/plans/2026-03-31-hrv-support.md | Step-by-step implementation plan for adding HRV support. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
Hi @eskimokk, thanks for the PR. One small request — could you please remove the Meanwhile, I will create another PR to fix the Pytest pipline EDIT |
|
@eskimokk Feel free to merge, when are you ready |
please merge |
fetch hrv data from web-api:
https://dev.fitbit.com/build/reference/web-api/heartrate-variability/