{ "info": { "author": "ORCAS", "author_email": "bpitcher@orcasinc.com", "bugtrack_url": null, "classifiers": [], "description": "python-misfit\n=============\n\n.. image:: https://travis-ci.org/orcasgit/python-misfit.svg?branch=master\n :target: https://travis-ci.org/orcasgit/python-misfit\n :alt: Build Status\n.. image:: https://coveralls.io/repos/orcasgit/python-misfit/badge.png?branch=master\n :target: https://coveralls.io/r/orcasgit/python-misfit?branch=master\n :alt: Coverage Status\n.. image:: https://requires.io/github/orcasgit/python-misfit/requirements.svg?branch=master\n :target: https://requires.io/github/orcasgit/python-misfit/requirements/?branch=master\n :alt: Requirements Status\n.. image:: https://readthedocs.org/projects/python-misfit/badge/?version=latest\n :target: http://python-misfit.readthedocs.org/en/latest/?badge=latest\n :alt: Documentation Status\n\nMisfit API Python Client Implementation\n\n.. _README-Requirements:\n\nRequirements\n============\n\n* Python >= 2.6, Python >= 3.3, or PyPy. You can download it from `here `_\n* Pip. If you have Python >= 2.7.9 or >= 3.4 then you already have ``pip``. Otherwise, please follow `these instructions `_\n\n.. _README-Installing:\n\nInstalling\n==========\n\nOnce you have satisfied the requirements listed above, install by running the\nfollowing command from the\n`terminal `_: ::\n\n pip install misfit\n\n.. _README-Installing-End:\n\nQuick Start\n===========\n\n.. _README-Quick-Start:\n\nInstall with ``pip install misfit``\n\n`Create an app `_ with \"Application Domain\" set to\nhttp://127.0.0.1:8080/. Now use the \"App key\" and \"App secret\" in the following\ncommand: ::\n\n misfit authorize --client_id= --client_secret=\n\nThat will save the necessary credentials for making further API calls to a file\ncalled \"misfit.cfg\". These credentials should be kept private. You can use same\nthe command-line client to access everything in the\n`Resource API `_. You can also access the\nsame resources using the Python API: ::\n\n >>> from misfit import Misfit\n >>> misfit = Misfit(, , )\n >>> print(misfit.profile())\n {u'gender': u'male', u'birthday': u'1981-07-18', u'userId': u'scrubbed', u'name': u'Brad Pitcher'}\n\n.. _README-Quick-Start-End:\n\nSlow Start\n==========\n\n.. _README-Slow-Start:\n\nAfter you have installed and `created your misfit app `_\nyou can authorize and use the API with your own web server rather than the\nbuilt-in CherryPy server like so: ::\n\n >>> from misfit.auth import MisfitAuth\n >>> auth = MisfitAuth(, , redirect_uri=)\n >>> auth_url = auth.authorize_url()\n\nNow redirect the user to ``auth_url``. When control returns to your web\nserver at the endpoint specified in ````, you will receive\n``code`` and ``state`` GET params you can pass to the\n``fetch_token`` method, which will return ``access_token``, which is\nneeded for further API calls: ::\n\n >>> access_token = auth.fetch_token(, )\n >>> from misfit import Misfit\n >>> misfit = Misfit(, , )\n >>> print(misfit.profile())\n {u'gender': u'male', u'birthday': u'1981-07-18', u'userId': u'scrubbed', u'name': u'Brad Pitcher'}\n\n.. _README-Notifications:\n\nNotifications\n=============\n\nThis library also includes some basic tools to ease notification handling. To\nuse Misfit's Notification API with your web application, the first thing you\nneed to do is set up an endpoint to accept POST requests on the domain you\nspecified when you created your app, like\n``http://example.com/misfit/notification/`` if your application domain is\n``http://example.com``.\n\nNow, when you handle the request, just create a ``MisfitNotification``\nobject with the body of the request as an argument. The\n``MisfitNotification`` constructor automatically verifies the signature of\nthe SNS message so you can feel secure in the knowledge that the message is\nlegitimate. It will raise ``cryptography.exceptions.InvalidSignature`` if\nthe signature is not valid.\n\nThe ``MisfitNotification`` class handles both subscription confirmation\nmessages and regular update messages. You can check the type of message by\nlooking at the ``Type`` attribute, which will be either\n``'SubscriptionConfirmation'`` or ``'Notification'``. For a\n``Notification`` message, you will find the updates as a list in a\n``Message`` attribute. After you process the updates (which can take no\nlonger than\n`15 seconds `_)\nmake sure to respond with an HTTP status of 200, otherwise SNS may try to\ndeliver it again. A full workflow should look something like this: ::\n\n >>> from misfit.notification import MisfitNotification\n >>> notification = MisfitNotification(content)\n >>> if notification.Type == 'Notification':\n >>> for message in notification.Message:\n >>> if message.type == 'goals':\n >>> # Handle goal update\n >>> # Handle other message types\n >>> # Give an empty response with a 200 status code\n\nOnce you have your endpoint up and running, go to your\n`app `_ and add your endpoint as a subscription\nhook URL, making sure the format is json. Click \"Test Endpoint\" and if all goes\nwell, the verification should seamlessly take place. If not, please\n`file an issue `_ and we will\ntry and help you debug. Now switch on all the resources you would like to\nreceive and click \"Update\". Soon you will be receiving Misfit notifications!", "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/orcasgit/python-misfit", "keywords": null, "license": "Apache 2.0", "maintainer": null, "maintainer_email": null, "name": "misfit", "package_url": "https://pypi.org/project/misfit/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/misfit/", "project_urls": { "Download": "UNKNOWN", "Homepage": "https://github.com/orcasgit/python-misfit" }, "release_url": "https://pypi.org/project/misfit/0.3.2/", "requires_dist": null, "requires_python": null, "summary": "Misfit API client implementation", "version": "0.3.2" }, "last_serial": 2438881, "releases": { "0.0.1": [ { "comment_text": "", "digests": { "md5": "c187b0b21f64b3c2ae186b5413d319b0", "sha256": "f7a6ee6b8de9fcd03e74e2e3d8fe5bc5b8ac74f44d36e7f6af5958a9aeb13c86" }, "downloads": -1, "filename": "misfit-0.0.1.tar.gz", "has_sig": false, "md5_digest": "c187b0b21f64b3c2ae186b5413d319b0", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4862, "upload_time": "2014-12-06T01:06:25", "url": "https://files.pythonhosted.org/packages/df/a0/4d372016d23be947951b6aa30a7027a6dd64d9ec1022f1ad2f140468c84a/misfit-0.0.1.tar.gz" } ], "0.1.0": [ { "comment_text": "", "digests": { "md5": "30e98d67542d6d2d15674f61a0729dae", "sha256": "6af119781e559ce942b43b9d03eade5308054390a243eca33a74f40f3646e8c8" }, "downloads": -1, "filename": "misfit-0.1.0.tar.gz", "has_sig": false, "md5_digest": "30e98d67542d6d2d15674f61a0729dae", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 12036, "upload_time": "2014-12-19T23:43:22", "url": "https://files.pythonhosted.org/packages/e6/10/7455ec5d4e9781ac17c43baa3aaf993f6f092863a56f7d32686393fb9a9a/misfit-0.1.0.tar.gz" } ], "0.1.1": [ { "comment_text": "", "digests": { "md5": "8ea7fa8631393926837f8c92800c89e3", "sha256": "b2cb72d45829239db04763fedbfdac6a24f9458bb67c089e599d6c2361ab9819" }, "downloads": -1, "filename": "misfit-0.1.1.tar.gz", "has_sig": false, "md5_digest": "8ea7fa8631393926837f8c92800c89e3", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 12005, "upload_time": "2014-12-22T18:40:48", "url": "https://files.pythonhosted.org/packages/ce/82/5164df4067cd1b933db2a49679451d0fd54fbcd41cfad33f402874838187/misfit-0.1.1.tar.gz" } ], "0.2.0": [ { "comment_text": "", "digests": { "md5": "6490588f01124c690890dbffabeae86b", "sha256": "989586e723f961fc0629dfb17cef265c0edf4b06b5149251d267b7bd08537330" }, "downloads": -1, "filename": "misfit-0.2.0.tar.gz", "has_sig": false, "md5_digest": "6490588f01124c690890dbffabeae86b", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 10606, "upload_time": "2015-01-31T23:07:18", "url": "https://files.pythonhosted.org/packages/ae/38/5c86434010aad8a775c7984c56be1c08a53d5809b8f4274f9de6666a4ad9/misfit-0.2.0.tar.gz" } ], "0.3.1": [ { "comment_text": "", "digests": { "md5": "af309880e4254d5fb685557e3191e384", "sha256": "f3363e9388df74713d5f53bdbbfea9ee1b8748ae206304a22de8299990f3d7da" }, "downloads": -1, "filename": "misfit-0.3.1.tar.gz", "has_sig": false, "md5_digest": "af309880e4254d5fb685557e3191e384", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 20718, "upload_time": "2015-10-07T00:29:56", "url": "https://files.pythonhosted.org/packages/87/2d/15e8a32cb4aa757911387a88a987200593598ef7fd7676106c63b7f308ad/misfit-0.3.1.tar.gz" } ], "0.3.2": [ { "comment_text": "", "digests": { "md5": "cca9955b60e4daba4734e1d4dff6bc8d", "sha256": "e12e12c3c39fbdf3c6fd407a7d822dbfde845120e93461343c0282e92f5e9c49" }, "downloads": -1, "filename": "misfit-0.3.2.tar.gz", "has_sig": false, "md5_digest": "cca9955b60e4daba4734e1d4dff6bc8d", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 18158, "upload_time": "2016-11-03T00:17:37", "url": "https://files.pythonhosted.org/packages/a7/ec/f925fe5e4f332ad5543a3ab69cfc64353f39675b23cafe918554fe365818/misfit-0.3.2.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "cca9955b60e4daba4734e1d4dff6bc8d", "sha256": "e12e12c3c39fbdf3c6fd407a7d822dbfde845120e93461343c0282e92f5e9c49" }, "downloads": -1, "filename": "misfit-0.3.2.tar.gz", "has_sig": false, "md5_digest": "cca9955b60e4daba4734e1d4dff6bc8d", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 18158, "upload_time": "2016-11-03T00:17:37", "url": "https://files.pythonhosted.org/packages/a7/ec/f925fe5e4f332ad5543a3ab69cfc64353f39675b23cafe918554fe365818/misfit-0.3.2.tar.gz" } ] }