GitXplorerGitXplorer
r

py-intervalsicu

public
13 stars
3 forks
1 issues

Commits

List of commits on branch main.
Verified
28fa18732664db8f3f7f9d582271f4a61a9b9b3d

Add method to get activities list. (#6)

bbenjmarshall committed a month ago
Verified
4eaa50266cb06e616b3071113e31f4c7e9df0852

Add Power curves (#5)

ccalumy committed 2 years ago
Verified
8720b55ef5cb1efbd063ac34e7055b55e1e86eaa

Field updates (#4)

rrday committed 2 years ago
Verified
8de3472acc24ea3e1395c0033391b756f779cd88

update requests, fix wellness (#3)

ffreekode committed 2 years ago
Unverified
19ce18acddb598ad09da01f6d5a06b4f57ae06f7

Remove debug

rrday committed 4 years ago
Unverified
27fb033dfb8dd815794a0f790638c98483cc4d9b

Add the activity_put API just a little early to be ready to deploy

rrday committed 4 years ago

README

The README file for this repository.

Intervals.ICU Python API

This API provides a basic interface to work with the Intervals.ICU. You can obtain further documentation for the Intervals.ICU site by following the instructions from this post.

API functionality is described in the thread above. This API aims to provide all functionality, but there are gaps. Please open an issue (or a PR) for any missing functionality.

Full documentation can be found here

Examples

Update a field in your wellness document

import pprint
from datetime import date

from intervalsicu import Intervals


def wellness():
    svc = Intervals("MY ATHLETE ID", "MY API KEY", strict=False)

    start = date.fromisoformat("2021-03-10")
    wellness = svc.wellness(start)
    wellness['restingHR'] = 57
    wellness = svc.wellness_put(wellness)
    pprint.pprint(wellness)


if __name__ == "__main__":
    wellness()

Write all your activities to a CSV file

import csv
import io

from intervalsicu import Intervals


def activities_to_csv():
    svc = Intervals("MY ATHLETE ID", "MY API KEY", strict=False)

    activities_csv = io.StringIO(svc.activities())

    with open('example/activities.csv', 'w') as w:
        reader = csv.reader(activities_csv)
        writer = csv.writer(w)
        
        for row in reader:
            writer.writerow(row)


if __name__ == "__main__":
    activities_to_csv()

Download a list of events in JSON.

import pprint
from datetime import date

from intervalsicu import Intervals


def events():
    svc = Intervals("MY ATHLETE ID", "MY API KEY")

    start = date.fromisoformat("2021-03-08")
    end = date.fromisoformat("2021-03-09")
    events = svc.events(start, end)
    pprint.pprint(events)


if __name__ == "__main__":
    events()