Skip to main content

sportgems

PyPI Python Build Status Deploy Docs

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 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. Simply install it using pip:

pip install sportgems

Documentation

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:

from sportgems import find_fastest_section_in_fit

desired_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:

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!

Metadata

Release files for sportgems 0.8.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Built distributions (wheels)

Table of built distributions (wheels) for sportgems 0.8.0
File
sportgems-0.8.0-cp311-cp311-manylinux2014_x86_64.whl CPython 3.11 CPython 3.11 Linux glibc 2.17+ x86-64 Details
sportgems-0.8.0-cp311-cp311-macosx_10_7_x86_64.whl CPython 3.11 CPython 3.11 macOS 10.7+ x86-64 Details
sportgems-0.8.0-cp310-cp310-manylinux2014_x86_64.whl CPython 3.10 CPython 3.10 Linux glibc 2.17+ x86-64 Details
sportgems-0.8.0-cp310-cp310-macosx_10_7_x86_64.whl CPython 3.10 CPython 3.10 macOS 10.7+ x86-64 Details
sportgems-0.8.0-cp39-cp39-manylinux2014_x86_64.whl CPython 3.9 CPython 3.9 Linux glibc 2.17+ x86-64 Details
sportgems-0.8.0-cp39-cp39-macosx_10_7_x86_64.whl CPython 3.9 CPython 3.9 macOS 10.7+ x86-64 Details
sportgems-0.8.0-cp38-cp38-manylinux2014_x86_64.whl CPython 3.8 CPython 3.8 Linux glibc 2.17+ x86-64 Details
sportgems-0.8.0-cp38-cp38-macosx_10_7_x86_64.whl CPython 3.8 CPython 3.8 macOS 10.7+ x86-64 Details

Total release size: 1.9 MB

Release files / sportgems-0.8.0-cp311-cp311-manylinux2014_x86_64.whl

Download URL sportgems-0.8.0-cp311-cp311-manylinux2014_x86_64.whl
Size 246.4 kB
Tags CPython 3.11 Linux glibc 2.17+ x86-64
SHA-256 checksum
How to use checksums
7a105d5999eb5cd408eb051adaca8f100b34aa60643d627147e9b3b91eefa959
BLAKE2b-256 checksum
How to use checksums
221c3a6a104063f23099606c95f980f8c980fb6a8436c04e391c535b1cf71a88
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via maturin/0.9.4

Release files / sportgems-0.8.0-cp311-cp311-macosx_10_7_x86_64.whl

Download URL sportgems-0.8.0-cp311-cp311-macosx_10_7_x86_64.whl
Size 222.3 kB
Tags CPython 3.11 macOS 10.7+ x86-64
SHA-256 checksum
How to use checksums
4f34452c71d7740388e9fb31f1e868f87f9ae6f4adef9b0b5216396bc114dabb
BLAKE2b-256 checksum
How to use checksums
dad429a3d19e5686d4de10bec3ac2073120325e988456a28524402ef2b3d50fc
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via maturin/0.9.4

Release files / sportgems-0.8.0-cp310-cp310-manylinux2014_x86_64.whl

Download URL sportgems-0.8.0-cp310-cp310-manylinux2014_x86_64.whl
Size 246.4 kB
Tags CPython 3.10 Linux glibc 2.17+ x86-64
SHA-256 checksum
How to use checksums
e3a0d65f011d2fdd997329b8d0be73639c364c2f0e20a8bcaa260c820a48d424
BLAKE2b-256 checksum
How to use checksums
220b37bcf4a8542ec56395d7ec45ee9661474a8b4bc08454555f52c2fe924418
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via maturin/0.9.4

Release files / sportgems-0.8.0-cp310-cp310-macosx_10_7_x86_64.whl

Download URL sportgems-0.8.0-cp310-cp310-macosx_10_7_x86_64.whl
Size 222.3 kB
Tags CPython 3.10 macOS 10.7+ x86-64
SHA-256 checksum
How to use checksums
32685406441afd814444ff172452a10ccde29dd22b42a5de5e66224e6da95947
BLAKE2b-256 checksum
How to use checksums
434e590310fc901a889ebf99562ce14ff950effcaa52083c59cf55419594849b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via maturin/0.9.4

Release files / sportgems-0.8.0-cp39-cp39-manylinux2014_x86_64.whl

Download URL sportgems-0.8.0-cp39-cp39-manylinux2014_x86_64.whl
Size 246.4 kB
Tags CPython 3.9 Linux glibc 2.17+ x86-64
SHA-256 checksum
How to use checksums
dce67ca50171d76200cadccdfaea13f228d91347344cf1c1df1a921456036309
BLAKE2b-256 checksum
How to use checksums
f774b5da614adb6049bc4c1f880837be0df5bf69956f83371cff7afbab0fa0f3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via maturin/0.9.4

Release files / sportgems-0.8.0-cp39-cp39-macosx_10_7_x86_64.whl

Download URL sportgems-0.8.0-cp39-cp39-macosx_10_7_x86_64.whl
Size 222.3 kB
Tags CPython 3.9 macOS 10.7+ x86-64
SHA-256 checksum
How to use checksums
f1bafba36d9ea004b46527dfbcba3429c26bcbe3ebcc0aef2f48ce1340f8e9e1
BLAKE2b-256 checksum
How to use checksums
14c841be5cf58c354a5c4d273cc1fc16f9c1bafe4fc239af53543a08540bc09d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via maturin/0.9.4

Release files / sportgems-0.8.0-cp38-cp38-manylinux2014_x86_64.whl

Download URL sportgems-0.8.0-cp38-cp38-manylinux2014_x86_64.whl
Size 246.0 kB
Tags CPython 3.8 Linux glibc 2.17+ x86-64
SHA-256 checksum
How to use checksums
06deaf699f8da5b611b472ebfaf1a2b2ab2e1538d24d02dfbf4a433796362bd1
BLAKE2b-256 checksum
How to use checksums
5846730d9b200099acd39098337eed511849ca6c7c97021f42b0d0a47480f952
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via maturin/0.9.4

Release files / sportgems-0.8.0-cp38-cp38-macosx_10_7_x86_64.whl

Download URL sportgems-0.8.0-cp38-cp38-macosx_10_7_x86_64.whl
Size 221.9 kB
Tags CPython 3.8 macOS 10.7+ x86-64
SHA-256 checksum
How to use checksums
aad40f2df06c5ab17604c3f4207cbf0806b0dd91f4dbce52806b01b6f2421f05
BLAKE2b-256 checksum
How to use checksums
4be8e5ec56407c139c5088992b0043d542cb171ca298b77a71a1b6f0621a84b2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via maturin/0.9.4

Release history Release notifications | RSS feed

This release

0.8.0 This release

8 release files

0.7.1

9 release files

0.7.0

12 release files

0.6.0

12 release files

0.4.2

13 release files

0.4.1

12 release files

0.3.0

13 release files

0.2.4

14 release files

0.2.3

14 release files

0.2.1

14 release files

0.2.0

12 release files

0.1.2

12 release files

0.1.1

3 release files

0.1.0

3 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page