{ "info": { "author": "Karthik Ravindra", "author_email": "karthikbgl@gmail.com", "bugtrack_url": null, "classifiers": [], "description": "JawboneUP API\r\n\r\nThis is a wrapper for the Jawbone UP API. \r\nIt has convenience methods for auth, access token, refresh token, and api calls.\r\n\r\nFor terminologies, refer to the documentation here:\r\nhttps://jawbone.com/up/developer/authentication\r\n\r\nUsage: \r\n\r\n from jawbone import Jawbone\r\n jb = Jawbone(client_id, client_secret, redirect_uri, scope='')\r\n\r\nThe app can be authorized for accessing specific data using the \"scope\"\r\nThe parameter \u201cscope\u201d, by default is 'basic_read', which can be set as per the application\u2019s requirements.\r\nMultiple scopes can be authorized by using space delimiters. \r\n\r\nTo see the list of available scopes, refer:\r\nhttps://jawbone.com/up/developer/authentication\r\n(under the heading The \u201cscopes\u201d allowed by the system are)\r\n\r\nSo, to use the package:\r\n\r\n1. Initialization:\r\n\r\n jb = Jawbone(client_id, client_secret, redirect_uri, scope='basic_read extended_read')\r\n\r\nTo make calls on behalf of the user, refer this documentation:\r\nhttps://jawbone.com/up/developer/authentication\r\n\r\nTo get the authorization token:\r\n\r\n jb.auth() \r\n\r\n\r\nThis call fetches the authentication URL. You should redirect the user to the generated authentication url. Upon successful authorization, the user is redirected to the \u201credirect_uri\u201d specified. The \u201ccode\u201d is specified as a GET parameter.\r\n\r\nIf there was an error, the response would be to the \u201credirect_uri\u201d with GET parameter \u201cerror\u201d \r\n\r\n\r\n2. Access Token\r\n\r\nOnce we have the code, you can get the auth code by calling \r\n\r\n token = jb.access_token(code)\r\n\t\r\nSave the generated token response json.\r\n\r\nThe response, if 200 has the following components as json:\r\n\r\naccess_token, token_type, expires_at, refresh_token\r\n\r\nStore these in the database, for future api calls.\r\n\r\n3. Refresh Token\r\n\r\nThe generated token from the above step has an expiry of 1 year. \r\nThe refresh token provided as a part of the access_token() call, can be used to obtain the new credentials \r\n\r\n response = jb.refresh_token_call(refresh_code)\r\n\r\n\r\n4. API Calls\r\n\r\napi_call is a generic method for calling any endpoint.\r\nDocumentation on endpoints here:\r\nhttps://jawbone.com/up/developer/endpoints\r\n\r\nTo make an API call to get sleep data: \r\n\r\n endpoint = nudge/api/v.1.0/sleep\r\n response = jb.api_call(access_token, endpoint)\r\n\r\nA response is a json with status_code (200, 400, etc). Parse the json for the response data\r\nIf response.status == 200, the response.get(\u201cerror\u201d) contains the message. \r\n\r\n\t\r\n\r\nThe library dependencies include:\r\n\r\n urllib\r\n requests", "description_content_type": null, "docs_url": null, "download_url": "UNKNOWN", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/karthikbgl/python-jawbone-up", "keywords": "", "license": "UNKNOWN", "maintainer": "", "maintainer_email": "", "name": "jawbone-up", "package_url": "https://pypi.org/project/jawbone-up/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/jawbone-up/", "project_urls": { "Download": "UNKNOWN", "Homepage": "https://github.com/karthikbgl/python-jawbone-up" }, "release_url": "https://pypi.org/project/jawbone-up/0.1/", "requires_dist": null, "requires_python": null, "summary": "Jawbone UP API python wrapper", "version": "0.1" }, "last_serial": 1046932, "releases": { "0.1": [ { "comment_text": "", "digests": { "md5": "e4d10a51704c0410466a2aa9789e4990", "sha256": "8b4aabb43869569a03e3de868ea6b12ce46b8fe0e1edf5d06b840b8238322af0" }, "downloads": -1, "filename": "jawbone-up-0.1.tar.gz", "has_sig": false, "md5_digest": "e4d10a51704c0410466a2aa9789e4990", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 2456, "upload_time": "2014-03-31T02:33:10", "url": "https://files.pythonhosted.org/packages/31/48/3bb9fc6cdd527eeaedd67147c96297be682ac338e486c676d2d7b66a7e07/jawbone-up-0.1.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "e4d10a51704c0410466a2aa9789e4990", "sha256": "8b4aabb43869569a03e3de868ea6b12ce46b8fe0e1edf5d06b840b8238322af0" }, "downloads": -1, "filename": "jawbone-up-0.1.tar.gz", "has_sig": false, "md5_digest": "e4d10a51704c0410466a2aa9789e4990", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 2456, "upload_time": "2014-03-31T02:33:10", "url": "https://files.pythonhosted.org/packages/31/48/3bb9fc6cdd527eeaedd67147c96297be682ac338e486c676d2d7b66a7e07/jawbone-up-0.1.tar.gz" } ] }