{ "info": { "author": "Jon Hagg", "author_email": "jhagg314@gmail.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 3 - Alpha", "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Natural Language :: English", "Programming Language :: Python", "Programming Language :: Python :: 2", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.4", "Programming Language :: Python :: 3.5", "Programming Language :: Python :: 3.6", "Programming Language :: Python :: 3.7" ], "description": "\n\nUsage:\n\nInstall the package:\n\n```\npip install oura\n```\n\nOnce you register an application, you can use this sample script to authorize access to your own data or some test account data. It will follow the auth code flow and print out the token response. \n```\n./token-request.py \n``` \n\nOr in your application, do\n```\nfrom oura import OuraClient, OuraOAuth2Client\n\nauth_client = OuraOAuth2Client(client_id='my_application', client_secret='random-string')\nurl = auth_client.authorize_endpoint(scope='defaults to all scopes', 'https://localhost/myendpoint')\n# user clicks url, auth happens, then redirect to given url\n```\n\nNow we handle the redirect by exchanging an auth code for a token\n\n```\n# save this somewhere, see below\ntoken_dict = auth_client.fetch_access_token(code='auth_code_from_query_string')\n```\n\nNow that's out of the way, you can call the api:\n```\n# supply all the params for auto refresh\noura = OuraClient(, , , )\n\n# or just these for make calls until token expires\noura = OuraClient(, )\n\n# make authenticated API calls\noura.user_info()\noura.sleep_summary(start='2018-12-05', end='2018-12-10')\noura.activity_summary(start='2018-12-25')\noura.readiness_summary() # throws exception since start is None\n```\n\n\nThe `refresh_callback` is a fuction that takes a token dict and saves it somewhere. It will look like:\n```\n{'token_type': 'bearer', 'refresh_token': , 'access_token': , 'expires_in': 86400, 'expires_at': 1546485086.3277025}\n```\n\nLive your life.\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/turing-complet/python-ouraring", "keywords": "", "license": "MIT", "maintainer": "", "maintainer_email": "", "name": "oura", "package_url": "https://pypi.org/project/oura/", "platform": "", "project_url": "https://pypi.org/project/oura/", "project_urls": { "Homepage": "https://github.com/turing-complet/python-ouraring" }, "release_url": "https://pypi.org/project/oura/1.0.3/", "requires_dist": [ "requests-oauthlib" ], "requires_python": ">=3.5.3", "summary": "Oura api client.", "version": "1.0.3" }, "last_serial": 4687635, "releases": { "1.0.2": [ { "comment_text": "", "digests": { "md5": "eefaf7bd47f37cb62cdbfc530d415b5e", "sha256": "5911a328326f48db00c4fb3e192b15c478d3b06f49ece6960dca182ac7859721" }, "downloads": -1, "filename": "oura-1.0.2-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "eefaf7bd47f37cb62cdbfc530d415b5e", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": ">=3.5.3", "size": 5603, "upload_time": "2019-01-08T10:14:05", "url": "https://files.pythonhosted.org/packages/70/44/15e1d81816dcec8ca7f367b68b68a6208599139478802155be84fd246028/oura-1.0.2-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "00367d7a6f2baf94cdd93562f23a7e87", "sha256": "340e1b6c62f763fdfcfffaf806f08e66f4332763721090dbac8738c0941bf72d" }, "downloads": -1, "filename": "oura-1.0.2.tar.gz", "has_sig": false, "md5_digest": "00367d7a6f2baf94cdd93562f23a7e87", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.5.3", "size": 5175, "upload_time": "2019-01-08T10:14:07", "url": "https://files.pythonhosted.org/packages/c2/04/fe6b603988043fa3d917b7cbd1421eed95facded7bbbe4a8dbcd539bec5e/oura-1.0.2.tar.gz" } ], "1.0.3": [ { "comment_text": "", "digests": { "md5": "8bdc3657894463c650511aa912b73cf1", "sha256": "b4e93bcfdd708a0eb6ee0bc4a87783c689e63790107df2e8385c22012135fa0a" }, "downloads": -1, "filename": "oura-1.0.3-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "8bdc3657894463c650511aa912b73cf1", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": ">=3.5.3", "size": 5662, "upload_time": "2019-01-12T02:25:57", "url": "https://files.pythonhosted.org/packages/a4/05/99ea86f783145f9d977183bc0b1a28e0a19743b1b9a3ff44855300ac93e5/oura-1.0.3-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "0d5ad6d713f0a745a1a222eeb9c8f34e", "sha256": "a747f099657d912aef719da359fb642f57216d8201881ed6b98afc6514630b49" }, "downloads": -1, "filename": "oura-1.0.3.tar.gz", "has_sig": false, "md5_digest": "0d5ad6d713f0a745a1a222eeb9c8f34e", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.5.3", "size": 5221, "upload_time": "2019-01-12T02:25:59", "url": "https://files.pythonhosted.org/packages/92/92/ae2ea7c293ad65228f5001297cd0e50b0f9e55c3534b5b3223f13c1300d2/oura-1.0.3.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "8bdc3657894463c650511aa912b73cf1", "sha256": "b4e93bcfdd708a0eb6ee0bc4a87783c689e63790107df2e8385c22012135fa0a" }, "downloads": -1, "filename": "oura-1.0.3-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "8bdc3657894463c650511aa912b73cf1", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": ">=3.5.3", "size": 5662, "upload_time": "2019-01-12T02:25:57", "url": "https://files.pythonhosted.org/packages/a4/05/99ea86f783145f9d977183bc0b1a28e0a19743b1b9a3ff44855300ac93e5/oura-1.0.3-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "0d5ad6d713f0a745a1a222eeb9c8f34e", "sha256": "a747f099657d912aef719da359fb642f57216d8201881ed6b98afc6514630b49" }, "downloads": -1, "filename": "oura-1.0.3.tar.gz", "has_sig": false, "md5_digest": "0d5ad6d713f0a745a1a222eeb9c8f34e", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.5.3", "size": 5221, "upload_time": "2019-01-12T02:25:59", "url": "https://files.pythonhosted.org/packages/92/92/ae2ea7c293ad65228f5001297cd0e50b0f9e55c3534b5b3223f13c1300d2/oura-1.0.3.tar.gz" } ] }