Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/fgebhart/sportgems
Find valuable gems 💎 in your 🚴 activities!
https://github.com/fgebhart/sportgems
activity parser pip python rust sports sports-data
Last synced: 2 months ago
JSON representation
Find valuable gems 💎 in your 🚴 activities!
- Host: GitHub
- URL: https://github.com/fgebhart/sportgems
- Owner: fgebhart
- License: mit
- Created: 2020-12-13T16:26:53.000Z (about 4 years ago)
- Default Branch: main
- Last Pushed: 2023-07-26T20:21:30.000Z (over 1 year ago)
- Last Synced: 2024-09-14T01:55:53.829Z (3 months ago)
- Topics: activity, parser, pip, python, rust, sports, sports-data
- Language: Rust
- Homepage: https://sportgems.fgebhart.dev
- Size: 1.9 MB
- Stars: 4
- Watchers: 2
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# sportgems
[![PyPI](https://badge.fury.io/py/sportgems.svg)](https://badge.fury.io/py/sportgems) [![Python](https://img.shields.io/pypi/pyversions/sportgems.svg?style=plastic)](https://badge.fury.io/py/sportgems) [![Build Status](https://github.com/fgebhart/sportgems/workflows/Test/badge.svg)](https://github.com/fgebhart/sportgems/actions?query=workflow%3ATest) [![Deploy Docs](https://github.com/fgebhart/sportgems/actions/workflows/deploy_docs.yml/badge.svg)](https://github.com/fgebhart/sportgems/actions/workflows/deploy_docs.yml)
Sportgems finds valuable gems 💎 in your activities 🚴
## What is it?
Sportgems lets you efficiently parse your activity data. It will search and find your
sections with either max velocity or max climb (see below). It will determine the start,
end and speed of whatever desired sections you are interested in, e.g. 1km, 2km, 10km
and others.Sportgems is used in [workoutizer](https://github.com/fgebhart/workoutizer) to find your
fastest 1km (and other 💎) in all your activities and visualize it. See for example this
screenshot of an activity in workoutizer, with the fastest 3km section being highlighted
in yellow:## Installation
Sportgems is written in rust and bundled in a python package using [pyo3](https://pyo3.rs/). Simply
install it using pip:
```
pip install sportgems
```## Documentation
[sportgems.fgebhart.dev](https://sportgems.fgebhart.dev/)## How to use it?
In order to search for gems 💎 in your activity, pass a path and desired distance to e.g.
`find_fastest_section_in_fit` like:```python
from sportgems import find_fastest_section_in_fitdesired_distance = 1_000 # in meter
path_to_fit_file = "tests/data/2019-09-14-17-22-05.fit"
result = find_fastest_section_in_fit(desired_distance, path_to_fit_file)
```
The result will be a python object with the following attributes:
```python
print(f'Found fastest section, from {result.start=} to {result.end=} with {result.velocity=} m/s')
```which prints:
```
Found fastest section, from result.start=635 to result.end=725 with result.velocity=2.898669803146783 m/s
```## Changelog
https://fgebhart.github.io/sportgems/changelog.html## Running the tests
In order to run the rust unit tests simply run
```
cargo test --no-default-features
```
To run the python tests, you first need to install the requirements
```
pip install -r requirements.txt
```
and build and install sportgems itself, by compiling it using
```
maturin build --interpreter python3.8 --compatibility manylinux2014 --skip-auditwheel
```
then installing the wheel with
```
pip install target/wheels/sportgems-*.whl
```
and subsequently run the tests
```
pytest tests/
```## Contributing
Contributions are welcome!