Skip to content
A python client library to interact with Polar Flow
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
flow
tests
.gitignore
LICENSE
README.rst
requirements.txt
setup.cfg
setup.py

README.rst

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.

You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.