Metadata-Version: 2.4
Name: chironpy
Version: 0.30.0
Summary: Workout analysis
Project-URL: Homepage, https://chironpy.chironapp.com
Project-URL: Repository, https://github.com/chironapp/chironpy
Project-URL: Documentation, https://chironpy.chironapp.com
Author-email: Clive Gross <clive@chironapp.com>
License: MIT
License-File: LICENSE
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: Intended Audience :: Science/Research
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Python :: 3.14
Classifier: Topic :: Scientific/Engineering
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Requires-Python: <4.0.0,>=3.11
Requires-Dist: fitparse<2,>=1.2.0
Requires-Dist: lmfit<2,>=1.3.0
Requires-Dist: numpy>=1.24.0
Requires-Dist: pandas<3,>=2.0.0
Requires-Dist: pydantic<3,>=2.0
Requires-Dist: pyyaml<7,>=6.0.0
Requires-Dist: scikit-learn<2,>=1.3.0
Requires-Dist: scipy<2,>=1.13.0
Requires-Dist: stravalib<3,>=2.0.0
Description-Content-Type: text/markdown

![chironpy](docs/img/chironpy-release-cover.jpg)

[![PyPI](https://img.shields.io/pypi/v/chironpy?style=flat-square)](https://pypi.org/project/chironpy/)
[![PyPI - Python Version](https://img.shields.io/pypi/pyversions/chironpy?style=flat-square)](https://pypi.org/project/chironpy/)
[![PyPI - Downloads](https://img.shields.io/pypi/dm/chironpy?style=flat-square)](https://pypi.org/project/chironpy/)
[![Tests](https://github.com/chironapp/chironpy/actions/workflows/test.yml/badge.svg)](https://github.com/chironapp/chironpy/actions/workflows/test.yml)
[![Documentation](https://img.shields.io/badge/docs-chironpy.chironapp.com-purple?style=flat-square)](https://chironpy.chironapp.com)

# chironpy

**chironpy** is a Python library for analysing endurance sports data. Load workouts from `.fit`, `.gpx`, `.tcx`, or the Strava API and analyse them with a familiar pandas-based interface — compute best intervals, elevation gain, speed, power, and more.

## Installation

```bash
# with uv (recommended)
uv add chironpy

# with pip
pip install chironpy
```

## Quickstart

```python
from chironpy import WorkoutData

# Load a workout file
data = WorkoutData.from_file("my_workout.fit")

# Best efforts — time-based and distance-based
data.best_intervals([60, 300, 1200], stream="power")
data.fastest_distance_intervals([1000, 5000, 10000])

# Elevation gain
data.elevation_gain()

# Resample to 10-second buckets
data.resample("10s")
```

## Key features

- **Multi-format loading** — `.fit`, `.gpx`, `.tcx`, and Strava activity streams
- **pandas-native** — `WorkoutData` subclasses `pd.DataFrame`; use any pandas method directly
- **Standardised columns** — `speed`, `power`, `heartrate`, `cadence`, `elevation`, `distance`, `latitude`, `longitude` regardless of source format
- **Best intervals** — time-based and distance-based personal bests
- **Elevation analysis** — gain, smoothed elevation, grade
- **Resampling** — downsample to any frequency with semantically correct per-column aggregations

## Documentation

Full documentation at [chironpy.chironapp.com](https://chironpy.chironapp.com)

## Contributing

See [CONTRIBUTING.md](CONTRIBUTING.md).

## Attribution

chironpy is a maintained fork of [sweatpy](https://github.com/GoldenCheetah/sweatpy) by [Maksym Sladkov](https://github.com/sladkovm) and [Aart Goossens](https://github.com/AartGoossens). The original project focused on cycling analysis; chironpy extends it with an emphasis on long-distance running.

With thanks to [Aaron Schroeder](https://github.com/aaron-schroeder) for work on running power and elevation metrics in [heartandsole](https://github.com/aaron-schroeder/heartandsole) and [spatialfriend](https://github.com/aaron-schroeder/spatialfriend).

## License

[MIT](docs/LICENSE)
