Skip to main content

Performance Velo Metrics Toolbox

Project description

VMPY is a toolbox for evaluating typical Cycling Performance Metrics from the ride data e.g. power, heart-rate, velocity, gradient, cadence streams.

All functions within the package do follow the convention, where input/output formats are either traditional Python built-in data structures or are the nd-arrays. This design choice favors easy integration into other projects, e.g. velometria.com

To help you getting started VMPY also provides a very thin wrapper around the Strava API.

Installation

Official release:

pip install vmpy

The bleeding edge work in progress:

pip install git+git://github.com/sladkovm/vmpy.git@development

Scope

The VMPY package provides the following functionality:

streams.py: Streams shape preserving calculations e.g. masking, filtering, zone conversions

metrics.py: Cycling Performance Metrics

strava.py: Python wrapper around the Strava API v3 for fetching Athletes, Activities and Stream data

Usage

>>> from vmpy import strava
>>> stream = strava.retrieve_streams(activity_id=1282167861, access_token=STRAVA_ACCESS_TOKEN)
>>> from vmpy import streams
>>> power_zones = streams.compute_zones(stream['watts'], ftp=270)
>>> hr_zones = streams.compute_zones(stream['heartrate'], lthr=160)
>>> watts_3sec = streams.rolling_mean(stream['watts'], window=3, mask=stream['moving'])
>>> gradient_wo_outliers = streams.median_filter(stream['grade_smooth'], window=31, threshold=1)
>>> from vmpy import metrics
>>> normalizes_power = metrics.normalized_power(stream['watts'])
>>> time_in_power_zones = metrics.time_in_zones(stream['watts'], ftp=260)

Quick Start

Register Strava App

In order to be able to use Strava API the user App must be registered at the linkhttp://www.strava.com/developers:

Application Name: ex.: My Awesome App

Website: ex.: myawesomeapp.com (can be anything, even your FB or Strava page will do)

Application Description ex.: Just fooling around with some Strava data

Authorization Callback Domain 127.0.0.1 (unless you are building a serious App)

Access Token

The Access Token will be found at the users profile page It will look like this: 83ebeabdec09f6670863766f792ead24d61fe3f9

Access Token must be passed explicitly as an argument to the functions found in strava.py module

Contribution guidelines

This project is absolutely open for contributions. No strong guidelines yet, except for:

  1. Don’t push on master branch

  2. Test

  3. Write docstrings in NumPy style

Project details


Download files

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

Source Distribution

vmpy-0.1.6.tar.gz (9.3 kB view details)

Uploaded Source

Built Distribution

vmpy-0.1.6-py2.py3-none-any.whl (11.8 kB view details)

Uploaded Python 2 Python 3

File details

Details for the file vmpy-0.1.6.tar.gz.

File metadata

  • Download URL: vmpy-0.1.6.tar.gz
  • Upload date:
  • Size: 9.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for vmpy-0.1.6.tar.gz
Algorithm Hash digest
SHA256 6c725ca5c26564bd7d4ac5d9eb2e3ddfd3fea46147129334f07619980a2fbda1
MD5 89d623ef451025072906d1ebdda409f6
BLAKE2b-256 b64df2a8becac4bb113eab992775ab9829d509a903f49a7a0651401d35ff7195

See more details on using hashes here.

File details

Details for the file vmpy-0.1.6-py2.py3-none-any.whl.

File metadata

File hashes

Hashes for vmpy-0.1.6-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 d1d6e4e18bd961fdda47b99c73005b010a40244953462edf82042549984d9174
MD5 87e081676072bfd0354919d15a540152
BLAKE2b-256 2861929b10072054839e31e28abf21c898fe1d5cca244c219f6a8f829ac970aa

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