{ "info": { "author": "Nat Burns", "author_email": "nbaccount@burnskids.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 2 - Pre-Alpha", "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Natural Language :: English", "Operating System :: OS Independent", "Topic :: Software Development :: Libraries :: Python Modules" ], "description": "# Polar AccessLink API Client\n\n[![image](https://img.shields.io/pypi/v/polar_accesslink.svg)](https://pypi.python.org/pypi/polar_accesslink)\n\nLibrary to enable access to Polar training data through the [Polar Open AccessLink](https://www.polar.com/accesslink-api) API. This library is a forked and packaged version of the offical [Polar AccessLink example client](https://github.com/polarofficial/accesslink-example-python).\n\n - Free software: MIT license\n\n## Prerequisites\n\n* [Polar Flow](https://flow.polar.com) account\n\n## Getting Started\n\n#### 1. Create new API client \n\nNavigate to https://admin.polaraccesslink.com. Log in with your Polar Flow account and create a new client using an appropriate OAuth2 callback URL for your application. Note the client ID and client secret -- you will need these later.\n\n#### 2. Authorize access \n\nUser account needs to be linked to client application before client can get any user data. User is asked for authorization in Polar Flow, and user is redirected back to application callback url with authorization code once user has accepted the request. Navigate to the URL given by `get_authorization_url()` to authorize the account access.\n\nSample code:\n```\nfrom accesslink import AccessLink\n\naccesslink = AccessLink(client_id=CLIENT_ID,\n client_secret=CLIENT_SECRET,\n redirect_url=REDIRECT_URL)\n\n# Navigate the user to the following URL so they can complete the authorization form.\n# Code for this will vary by application.\nauth_url = accesslink.get_authorization_url()\n```\n\n#### 3. Link user\n\nYour application should handle the callback request appropriately, storing the user ID and access token which will be necessary for later API calls. The user must first be registered with the given access token before additional API calls can be made.\n\nSample code:\n```\nfrom accesslink import AccessLink\n\naccesslink = AccessLink(client_id=CLIENT_ID,\n client_secret=CLIENT_SECRET,\n redirect_url=REDIRECT_URL)\n\nauthorization_code = request.args.get(\"code\")\ntoken_response = accesslink.get_access_token(authorization_code)\n\nUSER_ID = token_response[\"x_user_id\"]\nACCESS_TOKEN = token_response[\"access_token\"]\n\ntry:\n accesslink.users.register(access_token=ACCESS_TOKEN)\nexcept requests.exceptions.HTTPError as err:\n # Error 409 Conflict means that the user has already been registered for this client.\n # For most applications, that error can be ignored.\n if err.response.status_code != 409:\n raise err\n```\n\n#### 4. Access API data\n\nOnce user has linked their user account to client application and synchronizes data from Polar device to Polar Flow, application is able to load data.\n\nSample code:\n```\nfrom accesslink import AccessLink\n\naccesslink = AccessLink(client_id=CLIENT_ID,\n client_secret=CLIENT_SECRET)\n\nuser_info = accesslink.users.get_information(user_id=USER_ID,\n access_token=ACCESS_TOKEN)\n```\n\n", "description_content_type": "text/markdown", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/burnnat/polar_accesslink", "keywords": "polar_accesslink", "license": "MIT license", "maintainer": "", "maintainer_email": "", "name": "polar-accesslink", "package_url": "https://pypi.org/project/polar-accesslink/", "platform": "", "project_url": "https://pypi.org/project/polar-accesslink/", "project_urls": { "Homepage": "https://github.com/burnnat/polar_accesslink" }, "release_url": "https://pypi.org/project/polar-accesslink/0.0.5/", "requires_dist": [ "requests" ], "requires_python": "", "summary": "Python wrapper for Polar Open AccessLink API.", "version": "0.0.5" }, "last_serial": 5912169, "releases": { "0.0.1": [ { "comment_text": "", "digests": { "md5": "22d99da92ad9b743b476a292d3289aeb", "sha256": "4125e053a06d1ea856e8ecd8e936f188947d3d21669e92ff1764ef632ca6796e" }, "downloads": -1, "filename": "polar_accesslink-0.0.1-py3-none-any.whl", "has_sig": false, "md5_digest": "22d99da92ad9b743b476a292d3289aeb", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 5648, "upload_time": "2019-09-27T19:46:50", "url": "https://files.pythonhosted.org/packages/1a/3f/69d2985b5d54980009a08e281669598660f7d3a108062df6019bf2f9f732/polar_accesslink-0.0.1-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "21335f23f23dbc862a8251982521ea9d", "sha256": "4d400f12a5f90b5b951faab683e194e86fb4c4873289b09cc39ec3bebfd10707" }, "downloads": -1, "filename": "polar_accesslink-0.0.1.tar.gz", "has_sig": false, "md5_digest": "21335f23f23dbc862a8251982521ea9d", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4254, "upload_time": "2019-09-27T19:46:53", "url": "https://files.pythonhosted.org/packages/74/ab/1c719544b640da2ab594767ea1a997e0771d92fd7fdb7b80e3803b851edf/polar_accesslink-0.0.1.tar.gz" } ], "0.0.2": [ { "comment_text": "", "digests": { "md5": "986d3691847a70079a571777343e59ef", "sha256": "390e5a14870ea80b391395c1be0ae63af46945371da2dd80250520f63a7dc717" }, "downloads": -1, "filename": "polar_accesslink-0.0.2-py3-none-any.whl", "has_sig": false, "md5_digest": "986d3691847a70079a571777343e59ef", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 11487, "upload_time": "2019-09-28T02:18:35", "url": "https://files.pythonhosted.org/packages/bf/e8/3eab250281a75fe450292e68b47805b832720c2999392fa5d0f313d408e6/polar_accesslink-0.0.2-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "f33208c709a4974a9d8718e3c5bb3aeb", "sha256": "b1116283eb07c761a4e375f44dfff3e2489c132a4c6b0a98e17bc97995df0767" }, "downloads": -1, "filename": "polar_accesslink-0.0.2.tar.gz", "has_sig": false, "md5_digest": "f33208c709a4974a9d8718e3c5bb3aeb", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6841, "upload_time": "2019-09-28T02:18:37", "url": "https://files.pythonhosted.org/packages/12/df/4c608a104d6019b054b9dec7f0c10d4dca00a53dbac31d8ecfc7665d13e5/polar_accesslink-0.0.2.tar.gz" } ], "0.0.3": [ { "comment_text": "", "digests": { "md5": "10ceb44c9420150d86de4b39ec50507a", "sha256": "137a72048d67f032a9bc3e19d68d4e57a2252a08863e0720623c9771bed1fd92" }, "downloads": -1, "filename": "polar_accesslink-0.0.3-py3-none-any.whl", "has_sig": false, "md5_digest": "10ceb44c9420150d86de4b39ec50507a", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 11601, "upload_time": "2019-09-30T12:21:13", "url": "https://files.pythonhosted.org/packages/ca/e0/3fb5b3fa4a081a067a6081615c8ab73844ff05f4d08f34501b2d80f03c85/polar_accesslink-0.0.3-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "9871f5d2ffaec47e2805608b958983e2", "sha256": "857ea7b9a72d99b1e3919616c370fc0231f13b15959f66ef112bedb6e8394765" }, "downloads": -1, "filename": "polar_accesslink-0.0.3.tar.gz", "has_sig": false, "md5_digest": "9871f5d2ffaec47e2805608b958983e2", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6994, "upload_time": "2019-09-30T12:21:15", "url": "https://files.pythonhosted.org/packages/e0/d0/b18e7a062001bc4bda04c880d80bbb2e84688e8b527456b0d50349f8c5c2/polar_accesslink-0.0.3.tar.gz" } ], "0.0.4": [ { "comment_text": "", "digests": { "md5": "a1a2ee6afc6ec22609b3cb596cecbf38", "sha256": "422744e2029e6f9574128fb90fb156331aaa6d8113a96615503870755c96ce6e" }, "downloads": -1, "filename": "polar_accesslink-0.0.4-py3-none-any.whl", "has_sig": false, "md5_digest": "a1a2ee6afc6ec22609b3cb596cecbf38", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 11592, "upload_time": "2019-10-01T02:29:41", "url": "https://files.pythonhosted.org/packages/3d/6d/95107527e4b68e1fce68056b047cfffc6736b7412840ceb86e11f8d4720f/polar_accesslink-0.0.4-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "35f64e2a2b0cde9ab3790903daef1182", "sha256": "5323a3dfd9bcc8f921485c63ff937d49f99a2677eb99b1d96d099481b3e45f4f" }, "downloads": -1, "filename": "polar_accesslink-0.0.4.tar.gz", "has_sig": false, "md5_digest": "35f64e2a2b0cde9ab3790903daef1182", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6985, "upload_time": "2019-10-01T02:29:42", "url": "https://files.pythonhosted.org/packages/42/4f/0927601b2fdfa2beaa9cb8c7c0a85862e47d50dced8d9c4c3482bac83ee6/polar_accesslink-0.0.4.tar.gz" } ], "0.0.5": [ { "comment_text": "", "digests": { "md5": "6a2f37b3daf53d2e7ec208b28c39c5d4", "sha256": "81d738f282e44be47eb088f66183863cd9440511dd4237784eff27dbd5fd29ff" }, "downloads": -1, "filename": "polar_accesslink-0.0.5-py3-none-any.whl", "has_sig": false, "md5_digest": "6a2f37b3daf53d2e7ec208b28c39c5d4", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 11661, "upload_time": "2019-10-01T13:04:20", "url": "https://files.pythonhosted.org/packages/21/4e/e939cb52b307c231ca316d6aceb92fae877f257b004efd522e6daf5bf364/polar_accesslink-0.0.5-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "1b3dd8b1a56304ce216657dfd8d41686", "sha256": "b8133960f4880b47db67dc5d4e914c51b9e9446afaebec8348d681a7631aed1a" }, "downloads": -1, "filename": "polar_accesslink-0.0.5.tar.gz", "has_sig": false, "md5_digest": "1b3dd8b1a56304ce216657dfd8d41686", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7113, "upload_time": "2019-10-01T13:04:21", "url": "https://files.pythonhosted.org/packages/24/bd/a928f8601c5c0eedc961d28ca64fc47ec7f7fba7d47119852199dabc5fe5/polar_accesslink-0.0.5.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "6a2f37b3daf53d2e7ec208b28c39c5d4", "sha256": "81d738f282e44be47eb088f66183863cd9440511dd4237784eff27dbd5fd29ff" }, "downloads": -1, "filename": "polar_accesslink-0.0.5-py3-none-any.whl", "has_sig": false, "md5_digest": "6a2f37b3daf53d2e7ec208b28c39c5d4", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 11661, "upload_time": "2019-10-01T13:04:20", "url": "https://files.pythonhosted.org/packages/21/4e/e939cb52b307c231ca316d6aceb92fae877f257b004efd522e6daf5bf364/polar_accesslink-0.0.5-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "1b3dd8b1a56304ce216657dfd8d41686", "sha256": "b8133960f4880b47db67dc5d4e914c51b9e9446afaebec8348d681a7631aed1a" }, "downloads": -1, "filename": "polar_accesslink-0.0.5.tar.gz", "has_sig": false, "md5_digest": "1b3dd8b1a56304ce216657dfd8d41686", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7113, "upload_time": "2019-10-01T13:04:21", "url": "https://files.pythonhosted.org/packages/24/bd/a928f8601c5c0eedc961d28ca64fc47ec7f7fba7d47119852199dabc5fe5/polar_accesslink-0.0.5.tar.gz" } ] }