## Setup
- Python > 3.4
- pip install -r requirement.txt
## Install dev version in your notebook
This will install a python package named "revo-client" in your current environment
##### Local version
- ```pip install -e {PATH TO YOUR REPO}```
##### Repository version
- ```pip install revo-client```
## Create Client
By default a connect will connect to the production server
```python
from myotest import Client
# Connect to production server with your api token
client = Client("my-api-token")
# Connect to staging server
client = Client("my-api-token", server="staging")
# Connect to another server
client = Client("my-api-token", server="https://my-server")
# Create a client for another user ( you must be the user's coach to be able to get his information )
client = Client("my-api-token", user_id="other-user-uuid")
```
## Root queries
```python
# Fetch last workout that contains tags
workout = client.get_last_workout_with_tags(["vam_high", "ranges"])
# Fetch workout with id
workout = client.get_workout_with_id("workout-uuid")
# Fetch current profile
profile = client.get_profile()
```
## Objects
### Object :: Workout
#### Attributes
- id (ID)
- title (string)
- start (datetime)
- end (datetime)
- type (string) workout type
- target_duration (timedelta) workout requested duration
- effective_duration (timedelta)
- slots (list of Object::Slot)
- datasets (list of Object::Dataset)
- training_load (Object::TrainingLoad)
#### workout.get_dataset(name)
Return the dataset matching name, if the name is complete (i.e. "mil-1") the dataset is returned.
If the name is partial (i.e. "mil") the first dataset is returned (lower index)
#### workout.get_slots()
Return all workout slots in execution order
#### workout.get_slot_with_tags(tags)
Return the first slot (Object :: Slot) containing all tags, if any
```workout.get_slot_with_tags(["vm_high])```
### Object :: Dataset
#### Attributes
- id (ID)
- name (string)
- dataframe (Pandas dataframe)
- describe (dict) Full dataset describe
- avro_schema (dict)
- workout (Object::workout)
### Object :: Slot
#### Attributes
- id (ID)
- tags (list of string)
- type (string)
- value (Object::SlotValue)
- text (string)
- result (Object::SlotResult)
- end_time (datetime)
- start_time (datetime)
- power_type (string)
- analysis (list of dict)
- workout (Object::workout)
- training_load (Object::TrainingLoad)
### Object :: SlotResult
#### Attributes
- power (dict) Describe of power **("max","min","std","mean","count","median")**
- speed (dict) Describe of speed **("max","min","std","mean","count","median")**
- gps_power (dict) Describe of gps_power **("max","min","std","mean","count","median")**
- gps_speed (dict) Describe of gps_speed **("max","min","std","mean","count","median")**
- distance (float) distance in meters
- gps_distance (float) distance in meters
- regularity_90 (float) regularity 90% of the time
- step_count_ratio (float) step vs run ratio
- regularity_median (float) median on regularity
**gps_speed** and **gps_power** are only available if the mil contains those information, if
the user created a workout without gps, those values are null
### Object :: SlotValue
#### Attributes
- value (float) distance=meters, duration=seconds, repetition=count
- type (distance | duration | repetition )
### Object :: Profile
#### Attributes
- id (ID)
- full_name (string)
- gender (male|female)
- weight (float) in kilogram
- height (float) in meter
- leg_length (float) in meter
- waist (float) in meter
- vma (float)
- pma (float)
- birth_date (date)
- age (float) in years
### Object :: AvroSchema
#### Attributes
- name (string)
- type (string) record type
- fields (Array of dict)
### Object :: TrainingLoad
Training load is only available to a slot using PMA calculation.
For other slot types, all the values are 0
#### Attributes
- requested_min (integer) requested training load minimum
- requested_max (integer) requested training load maximum
- fields (Array of dict) effetctive training load
## Script Example
```python
from myotest import Client
client = Client("my-api-token")
workout = client.get_last_workout_with_tags(["vma_high"])
await workout.load_slots()
slot = workout.get_slot_with_tags(["vma_high"])
profile = client.get_profile()
print(
"Hello I'm {} and I am {} years old, my last"
"vma workout had a regularity of {}".format(
profile.full_name,
profile.age,
slot.result.regularity_median))
```
Metadata
Release files for revo-client 0.9.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| revo-client-0.9.0.tar.gz | 13.6 kB | Without provenance | Details for revo-client-0.9.0.tar.gz |
Release files / revo-client-0.9.0.tar.gz
| Download URL | revo-client-0.9.0.tar.gz |
|---|---|
| Size | 13.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
62ff67d15dc19a02f8456851aa0f47eb3ed7aef7b9bb5c74fd59e1c97b550bfb
|
|
BLAKE2b-256 checksum How to use checksums |
99e0e8332abb61c031a876068f8ef2422d2ab8f610006caed86d29ea042b456f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/1.12.1 pkginfo/1.4.2 requests/2.20.0 setuptools/40.5.0 requests-toolbelt/0.8.0 tqdm/4.28.1 CPython/3.6.3
|
Security for revo-client 0.9.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.