Metadata-Version: 2.5
Name: sweatstack
Version: 0.92.0
Summary: The official Python client for SweatStack
Project-URL: Homepage, https://sweatstack.no
Project-URL: Documentation, https://docs.sweatstack.no/learn/python/
Project-URL: Repository, https://github.com/SweatStack/sweatstack-python
Project-URL: Issues, https://github.com/SweatStack/sweatstack-python/issues
Project-URL: Changelog, https://github.com/SweatStack/sweatstack-python/blob/main/CHANGELOG.md
Author-email: Aart Goossens <aart@sweatstack.no>
License-Expression: MIT
License-File: LICENSE
Keywords: api,client,fitness,sports,sweatstack
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Requires-Python: >=3.10
Requires-Dist: email-validator>=2.2.0
Requires-Dist: httpx>=0.28.1
Requires-Dist: open-sport-taxonomy[pydantic]>=0.10.0
Requires-Dist: platformdirs>=4.0.0
Requires-Dist: pydantic>=2.10.5
Provides-Extra: arrow
Requires-Dist: pyarrow>=20.0.0; extra == 'arrow'
Provides-Extra: fastapi
Requires-Dist: cryptography>=41.0.0; extra == 'fastapi'
Requires-Dist: fastapi[standard]>=0.100.0; extra == 'fastapi'
Provides-Extra: pandas
Requires-Dist: pandas>=2.2.3; extra == 'pandas'
Requires-Dist: pyarrow>=20.0.0; extra == 'pandas'
Provides-Extra: polars
Requires-Dist: polars>=1.30; extra == 'polars'
Provides-Extra: streamlit
Requires-Dist: pandas>=2.2.3; extra == 'streamlit'
Requires-Dist: pyarrow>=20.0.0; extra == 'streamlit'
Requires-Dist: streamlit>=1.42.0; extra == 'streamlit'
Description-Content-Type: text/markdown

# SweatStack Python SDK

The official Python client for [SweatStack](https://sweatstack.no), the sports data platform:
one API for activities, time series, lab tests and daily measures from every wearable.

## Install

```bash
uv add "sweatstack[polars]"     # analysis with Polars
uv add "sweatstack[pandas]"     # analysis with pandas
uv add sweatstack               # models only: FastAPI services, webhook consumers
```

Other extras: `[arrow]` (DuckDB), `[streamlit]` and `[fastapi]` (sign-in helpers). Extras
combine: `sweatstack[polars,arrow]`.

## Quickstart

```python
from sweatstack import Client

client = Client()
client.authenticate()  # opens the browser once; the sign-in is saved for later runs

latest = client.activities.latest()
if latest is None:
    raise SystemExit("No activities yet: connect a wearable at https://app.sweatstack.no")
print(latest.sport, latest.start_local)

data = client.activities.data(latest.id, metrics=["power", "heart_rate"])
print(data.head())
```

Every endpoint group is an attribute named after its URL: `/api/v1/activities/...` is
`client.activities`, `/api/v1/tests/...` is `client.tests`. Collections take `output=`
(`"polars"`, `"pandas"`, `"arrow"`) for a frame instead of models.

In a script or notebook, the module-level functions use one shared client:
`sweatstack.activities.list()`. In an app that serves several users, use one `Client` per user,
such as the ones the FastAPI and Streamlit helpers give you.

## For coding agents

Install the SDK's [agent skill](skills/sweatstack-python/SKILL.md) for Claude Code, Cursor, Codex
and other agents:

```bash
npx skills add SweatStack/sweatstack-python
```

## Documentation

- [Python SDK guide](https://docs.sweatstack.no/learn/python/): authentication,
  clients, data output, errors, Streamlit and FastAPI
- [API reference](https://docs.sweatstack.no/learn/api-reference/): every endpoint and model
- [Changelog](https://docs.sweatstack.no/learn/python/changelog/) and [upgrade notes](https://docs.sweatstack.no/learn/python/upgrading/)

Sports follow [OpenSportTaxonomy](https://open-sport-taxonomy.sweatstack.no): `sweatstack.Sport`
is its `Sport` type.
