Find valuable gems 💎 in your tracked sport 🚴 activity!
Project description
sportgems
Sportgems finds valuable gems 💎 in your tracked sport 🚴 activity!
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 bundled in a python package using pyo3. Simply install it using pip:
pip install sportgems
The following interfacing functions are available:
function name | purpose |
---|---|
find_fastest_section |
parse your activity data to find the fastest section |
find_fastest_section_in_fit |
parse your activity .fit file to find the fastest section |
find_best_climb_section |
parse your activity data to find the best climb section |
find_best_climb_section_in_fit |
parse your activity .fit file to find the best climb section |
parse_fit_data |
parse your activity .fit file to get e.g. timestamps , coordinates , altitude and calories |
Have a look at the docstrings of these functions for more details.
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
How does it work?
The following diagram illustrates how the core algorithm (implemented in gem_finder.cpp
) works:
Changelog
See CHANGELOG.md.
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 subsequently run the tests
pytest tests/
Contributing
Contributions are welcome!
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
Built Distributions
Hashes for sportgems-0.5.0-cp39-none-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | be8b552aa57eafc9e9182ca489c728b520692206cff0d04d8b43e4f3fda03939 |
|
MD5 | 356892dae0d1ad9d3fdee47377ba073d |
|
BLAKE2b-256 | 7b3f1e634ed7bdb519760a95ab384d6fdf3fc2783f5fe5e98ef71b228de57fd2 |
Hashes for sportgems-0.5.0-cp39-cp39-manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4a06cf8c432566f8412f5a5e54d7a3b592ad45cc31298eaee30b7d4d470f00c1 |
|
MD5 | 7739663dabeafc46f1430b485f5931ce |
|
BLAKE2b-256 | 86acd51bb183a7d30e78d12b7e6d4ef4cdcad533367f3f97d99e34fc8a494269 |
Hashes for sportgems-0.5.0-cp39-cp39-macosx_10_7_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f9d9065c401f0d07226c8715b4b9e7cb09a9386786aee2b2ff22578b59460625 |
|
MD5 | b1652369661561dcc03ef384a54ad5c1 |
|
BLAKE2b-256 | 582f6978ed2f246d5ecd1269e9191080cd4095630ba98bca89468e37e9cfe173 |
Hashes for sportgems-0.5.0-cp38-none-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | cf90e4a9e73a2a5fa9138ef57fdf96816044af8d621c913b5b5cc13925f8b483 |
|
MD5 | 00e65ff142b58e60dcd45476ffc83449 |
|
BLAKE2b-256 | c4c97f096dbbb7eafb49d882e5c0e5ef148237b730552a1319e774dfbf41c8bb |
Hashes for sportgems-0.5.0-cp38-cp38-manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5f3b0df3f4126f78fb6936cba552bf9d462677006612cde23e5ce84af833ffc3 |
|
MD5 | 8052aa77791acf938972fdffe0155777 |
|
BLAKE2b-256 | ad863dfdc659a763a433db144b52ba6a0a8f55fc2a6957485feca46d921586fc |
Hashes for sportgems-0.5.0-cp38-cp38-macosx_10_7_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | aeb556bec8b618cef4bf961cb09368a9e58a63b858768a895dc19018cf279159 |
|
MD5 | 73572643166900a29995dfd0e145e4d7 |
|
BLAKE2b-256 | cd3199950b310a1007a1ca955357114c613403d2f582fd7117a40b7522100168 |
Hashes for sportgems-0.5.0-cp38-cp38-linux_armv7l.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 34d92b2b532266c1577888550995161c4039797b18034621deec5392aa97d67f |
|
MD5 | 90ae7e8b354d211a534eb474b9e53732 |
|
BLAKE2b-256 | 7eb0d61c6483e36f14220d80e2f67a2c9116be2de7ba6e34ada91e3b62faf9bc |
Hashes for sportgems-0.5.0-cp37-none-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 921032ea8986200510588eb4c7af6528c2796dfdca697f8ce8be9df0626e1b45 |
|
MD5 | 33af19d3d1235029ff2df5db3aec310f |
|
BLAKE2b-256 | 3547a4f28fe847b1315e4f0b1cb09491f3610921d21cbd13024ed90d80980a9d |
Hashes for sportgems-0.5.0-cp37-cp37m-manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ecd52062ec45900fb4b41b7275c8586fe3be93f9d6e5f3735f1c0a325da38631 |
|
MD5 | b038cfca64619eeecf68605701ee8be6 |
|
BLAKE2b-256 | 8163c92469829ef0b9d39950bcc805f7a543f75b7ffa60b0c8e874e7b1cc3827 |
Hashes for sportgems-0.5.0-cp37-cp37m-macosx_10_7_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 789491bc11f5e6d6ea93945320fbcf240b460dda1540be724664e722aaa07a79 |
|
MD5 | ce1eebedb4865e9fe04994f4c8a5a0b9 |
|
BLAKE2b-256 | cf6806ef9c8c7be3e292e21fa98ac00fa9553d4ed258fd6469f2e9970fb337d8 |
Hashes for sportgems-0.5.0-cp37-cp37m-linux_armv7l.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 82e3fe7cf75f27e8eb52d4dae65fc5fd44135069666c53428eccfe7d8a471fe1 |
|
MD5 | 04dbbd57f6a41b925a904f9fe8fe7dab |
|
BLAKE2b-256 | fb78bf5ac380a0a8c0ecdd6bbcee32c8a3574f3e3107ace0b23f0d2c50f17701 |
Hashes for sportgems-0.5.0-cp36-none-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6bbb7421617e95d53d87e0b44fa6a267b96329b34dd41582d650430354cf9b35 |
|
MD5 | c282d26f7169ef44fa2c7c13bca5f739 |
|
BLAKE2b-256 | f962e9b1e46e8773d42a01f16793017a32ce30d57043fb35e36e51e64b3f9a00 |
Hashes for sportgems-0.5.0-cp36-cp36m-manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4f42cee409b2b39f913af1ad499f7d29e053585416effde78e3be6d521fae448 |
|
MD5 | 7e706c689fb35c8c1c6ad57d2909f181 |
|
BLAKE2b-256 | 37871c4924b1a34245d35f971e828433f6885b5a1e167e8b17a4e4f9a159f8b6 |
Hashes for sportgems-0.5.0-cp36-cp36m-macosx_10_7_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9dd24a3e348840f19478a5ff7f64aaeeba1e949a82fd52ed018fc14f3816b601 |
|
MD5 | 1e088709b0607cbd72938b8a33ffa4b4 |
|
BLAKE2b-256 | 3ee6a9ec88eaddc56eb927cbf8f66608466d6ee45ebc96621c04e5f232cf0f62 |