Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 9 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@ on:

jobs:
test:
strategy:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
python-version: ["pypy3.11", "3.11", "3.12", "3.13"]
name: test
runs-on: ubuntu-latest
steps:
Expand All @@ -19,10 +23,13 @@ jobs:
with:
fetch-depth: 0

- name: Set up Python 3.13
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: "3.13"
python-version: ${{ matrix.python-version }}

- name: Display Python version
run: python -c "import sys; print(sys.version)"

- name: Install PDM
run: |
Expand Down
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -65,4 +65,4 @@ _cov_html
secrets.json
tokens.json
TODO.md

.tool-versions
17 changes: 11 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
# Python API Client for Fitbit™

# Fitbit Client

[![CI](https://github.com/jpstroop/fitbit-client-python/actions/workflows/ci.yml/badge.svg)](https://github.com/jpstroop/fitbit-client-python/actions/workflows/ci.yml)
[![codecov](https://codecov.io/gh/jpstroop/fitbit-client-python/graph/badge.svg?token=DM0JD8VKZ4)](https://codecov.io/gh/jpstroop/fitbit-client-python)

Expand All @@ -10,7 +8,14 @@
[![Imports: isort](https://img.shields.io/badge/%20imports-isort-%231674b1?style=flat&labelColor=ef8336)](https://pycqa.github.io/isort/)
[![Doc style: MDformat](https://img.shields.io/badge/doc_style-mdformat-1c55ff?style=flat)](https://mdformat.readthedocs.io/en/stable/)

[![Python 3.13+](https://img.shields.io/badge/python-3.13+-blue.svg)](https://www.python.org/downloads/release/python-3130/)
[![PyPy 3.11](https://img.shields.io/badge/pypy-3.11-4bb2c5.svg)](https://doc.pypy.org/en/latest/release-v7.3.17.html)
[![Python 3.11](https://img.shields.io/badge/python-3.11-1e405d.svg)](https://www.python.org/downloads/release/python-3110/)
[![Python 3.12](https://img.shields.io/badge/python-3.12-1e405d.svg)](https://www.python.org/downloads/release/python-3120/)
[![Python 3.13](https://img.shields.io/badge/python-3.13-1e405d.svg)](https://www.python.org/downloads/release/python-3130/)

[![Linux](https://img.shields.io/badge/Linux-FCC624?logo=linux&logoColor=black)](#)
[![macOS](https://img.shields.io/badge/macOS-000000?logo=apple&logoColor=F0F0F0)](#)
[![Windows](https://custom-icon-badges.demolab.com/badge/Windows-0078D6?logo=windows11&logoColor=white)](#)

[![License: AGPL v3](https://img.shields.io/badge/License-AGPL%20v3-blue.svg)](https://www.gnu.org/licenses/agpl-3.0)

Expand All @@ -19,7 +24,7 @@ OAuth2 PKCE authentication and resource-based API interactions.

## Installation

This package requires Python 3.13 (or later, when there is a later).
Requires Python 3.11 or later

Once published, install like this:

Expand Down Expand Up @@ -160,8 +165,8 @@ between sessions. If provided, the client will:

## Pagination

Some Fitbit API endpoints support pagination for large result sets. With this
client, you can work with paginated endpoints in two ways:
Some Fitbit API endpoints support pagination for large result sets. You can work
with paginated endpoints in two ways:

```python
# Standard way - get a single page of results
Expand Down
7 changes: 4 additions & 3 deletions fitbit_client/resources/intraday.py
Original file line number Diff line number Diff line change
Expand Up @@ -374,7 +374,7 @@ def get_activity_intraday_by_interval(
IntradayDetailLevel.FIVE_MINUTES,
IntradayDetailLevel.FIFTEEN_MINUTES,
]
if detail_level not in IntradayDetailLevel:
if detail_level not in valid_levels:
raise IntradayValidationException(
message="Invalid detail level",
field_name="detail_level",
Expand Down Expand Up @@ -532,11 +532,12 @@ def get_heartrate_intraday_by_date(
Personal applications automatically have access to intraday data.
Other application types require special approval from Fitbit.
"""
if detail_level not in IntradayDetailLevel:
valid_levels = list(IntradayDetailLevel)
if detail_level not in valid_levels:
raise IntradayValidationException(
message="Invalid detail level",
field_name="detail_level",
allowed_values=[l.value for l in IntradayDetailLevel],
allowed_values=[l.value for l in valid_levels],
resource_name="heart rate",
)

Expand Down
Loading