Skip to content
This repository has been archived by the owner on Feb 4, 2021. It is now read-only.

campbellr/flow-client

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Flow

A python client for Polar Flow.

NOTE: This project was created before Polar opened their Polar AccessLink API. You are much better off using that. An official python example can be found at https://github.com/polarofficial/accesslink-example-python

Features

  • Fetch a list of activities within given date range
  • Fetch the TCX file for any training session
  • Fetch raw training session data (TODO)
  • Fetch activity data (steps, goal, etc...) (TODO)

Install

This package isn't on PyPi yet, so the easiest way to install is directly from the git repository:

$ pip install git+git://github.com/campbellr/flow-client.git

Usage

Usage is fairly simple. Simply instantiate a FlowClient, login with your Polar Flow credentials and fetch activities with the activities method:

>>> from flow import FlowClient
>>>
>>> client = FlowClient()
>>> client.login('username@example.com', 'password')
>>> # no arguments will fetch all activities in the last 30 days
>>> activity = client.activities()[0]
>>> print activity
Activity(63464689)
>>> print activity.type
EXERCISE
>>> print activity.datetime
2015-03-10T19:38:18.000Z
>>> print activity.distance
4964.10009766

The entire list of attributes of an Activity can be viewed using dir.

Finally, you can download the tcx file for a given activity with the Activty.tcx method:

  >>> print activity.tcx()
  <?xml version="1.0" encoding="UTF-8"?><TrainingCenterDatabase xmlns="http://www.garmin.com/xmlschemas/TrainingCenterDatabase/v2"><Activities><Activity Sport="Running"><Id>2015-03-10T19:38:18.000Z</Id><Lap StartTime="2015-03-10T19:38:18.000Z"><TotalTimeSeconds>426.0</TotalTimeSeconds><DistanceMeters>1000.0</DistanceMeters>
[...]

Contributing

Contributions are greatly appreciated! Feel free to submit a pull request, or file an issue in our issue tracker.

About

A python client library to interact with Polar Flow

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages