GithubHelp home page GithubHelp logo

gyptazy / flow-client Goto Github PK

View Code? Open in Web Editor NEW

This project forked from campbellr/flow-client

0.0 1.0 0.0 13 KB

A python client library to interact with Polar Flow

License: Apache License 2.0

Python 100.00%

flow-client's Introduction

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('[email protected]', '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.

flow-client's People

Contributors

campbellr avatar

Watchers

Florian avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.