Skip to main content

Find valuable gems 💎 in your tracked sport 🚴 activity!

Project description

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!

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distributions

sportgems-0.8.0-cp311-cp311-manylinux2014_x86_64.whl (246.4 kB view details)

Uploaded CPython 3.11

sportgems-0.8.0-cp311-cp311-macosx_10_7_x86_64.whl (222.3 kB view details)

Uploaded CPython 3.11 macOS 10.7+ x86-64

sportgems-0.8.0-cp310-cp310-manylinux2014_x86_64.whl (246.4 kB view details)

Uploaded CPython 3.10

sportgems-0.8.0-cp310-cp310-macosx_10_7_x86_64.whl (222.3 kB view details)

Uploaded CPython 3.10 macOS 10.7+ x86-64

sportgems-0.8.0-cp39-cp39-manylinux2014_x86_64.whl (246.4 kB view details)

Uploaded CPython 3.9

sportgems-0.8.0-cp39-cp39-macosx_10_7_x86_64.whl (222.3 kB view details)

Uploaded CPython 3.9 macOS 10.7+ x86-64

sportgems-0.8.0-cp38-cp38-manylinux2014_x86_64.whl (246.0 kB view details)

Uploaded CPython 3.8

sportgems-0.8.0-cp38-cp38-macosx_10_7_x86_64.whl (221.9 kB view details)

Uploaded CPython 3.8 macOS 10.7+ x86-64

File details

Details for the file sportgems-0.8.0-cp311-cp311-manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for sportgems-0.8.0-cp311-cp311-manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 7a105d5999eb5cd408eb051adaca8f100b34aa60643d627147e9b3b91eefa959
MD5 d49d4096513d7622f588d2e8a632aff4
BLAKE2b-256 221c3a6a104063f23099606c95f980f8c980fb6a8436c04e391c535b1cf71a88

See more details on using hashes here.

File details

Details for the file sportgems-0.8.0-cp311-cp311-macosx_10_7_x86_64.whl.

File metadata

File hashes

Hashes for sportgems-0.8.0-cp311-cp311-macosx_10_7_x86_64.whl
Algorithm Hash digest
SHA256 4f34452c71d7740388e9fb31f1e868f87f9ae6f4adef9b0b5216396bc114dabb
MD5 39d6400d1802f49db3db7e2b7c83e84a
BLAKE2b-256 dad429a3d19e5686d4de10bec3ac2073120325e988456a28524402ef2b3d50fc

See more details on using hashes here.

File details

Details for the file sportgems-0.8.0-cp310-cp310-manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for sportgems-0.8.0-cp310-cp310-manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 e3a0d65f011d2fdd997329b8d0be73639c364c2f0e20a8bcaa260c820a48d424
MD5 2832eb715cb39276f70a6462495f6f6e
BLAKE2b-256 220b37bcf4a8542ec56395d7ec45ee9661474a8b4bc08454555f52c2fe924418

See more details on using hashes here.

File details

Details for the file sportgems-0.8.0-cp310-cp310-macosx_10_7_x86_64.whl.

File metadata

File hashes

Hashes for sportgems-0.8.0-cp310-cp310-macosx_10_7_x86_64.whl
Algorithm Hash digest
SHA256 32685406441afd814444ff172452a10ccde29dd22b42a5de5e66224e6da95947
MD5 7bb5304b3026e6852e47f3ec2038d595
BLAKE2b-256 434e590310fc901a889ebf99562ce14ff950effcaa52083c59cf55419594849b

See more details on using hashes here.

File details

Details for the file sportgems-0.8.0-cp39-cp39-manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for sportgems-0.8.0-cp39-cp39-manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 dce67ca50171d76200cadccdfaea13f228d91347344cf1c1df1a921456036309
MD5 9bd795d86cbdd1d11cbfca3811fe4bb6
BLAKE2b-256 f774b5da614adb6049bc4c1f880837be0df5bf69956f83371cff7afbab0fa0f3

See more details on using hashes here.

File details

Details for the file sportgems-0.8.0-cp39-cp39-macosx_10_7_x86_64.whl.

File metadata

File hashes

Hashes for sportgems-0.8.0-cp39-cp39-macosx_10_7_x86_64.whl
Algorithm Hash digest
SHA256 f1bafba36d9ea004b46527dfbcba3429c26bcbe3ebcc0aef2f48ce1340f8e9e1
MD5 67c35a2269cf7a790263abd592a17a4b
BLAKE2b-256 14c841be5cf58c354a5c4d273cc1fc16f9c1bafe4fc239af53543a08540bc09d

See more details on using hashes here.

File details

Details for the file sportgems-0.8.0-cp38-cp38-manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for sportgems-0.8.0-cp38-cp38-manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 06deaf699f8da5b611b472ebfaf1a2b2ab2e1538d24d02dfbf4a433796362bd1
MD5 386d64515141c3f7e607e9e29ba5166d
BLAKE2b-256 5846730d9b200099acd39098337eed511849ca6c7c97021f42b0d0a47480f952

See more details on using hashes here.

File details

Details for the file sportgems-0.8.0-cp38-cp38-macosx_10_7_x86_64.whl.

File metadata

File hashes

Hashes for sportgems-0.8.0-cp38-cp38-macosx_10_7_x86_64.whl
Algorithm Hash digest
SHA256 aad40f2df06c5ab17604c3f4207cbf0806b0dd91f4dbce52806b01b6f2421f05
MD5 6cb029a06801c9bb8eb2cbf79a083d5a
BLAKE2b-256 4be8e5ec56407c139c5088992b0043d542cb171ca298b77a71a1b6f0621a84b2

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page