{ "info": { "author": "Nathan Yergler", "author_email": "nathan@eventbrite.com", "bugtrack_url": null, "classifiers": [ "License :: OSI Approved :: BSD License" ], "description": "========\nDesk API\n========\n\n.. image:: https://travis-ci.org/eventbrite/deskapi.png?branch=master\n :target: https://travis-ci.org/eventbrite/deskapi\n :alt: Build Status\n\n.. image:: https://coveralls.io/repos/eventbrite/deskapi/badge.png?branch=master\n :target: https://coveralls.io/r/eventbrite/deskapi?branch=master\n :alt: Test Coverage\n\ndeskapi is a Python wrapper around the `Desk.com REST API`_. It\nprovides Python wrappers for articles, topics, and translations.\ndeskapi is compatible with Python 2.6, 2.7, and 3.3.\n\n.. _`Desk.com REST API`: http://dev.desk.com/\n\n\nInstallation\n============\n\ndeskapi is installable from PyPI_ with ``easy_install`` or pip_.\n\n::\n\n $ pip install deskapi\n\nThis will download the latest release, along with requests_, which it\ndepends on.\n\n.. _PyPI: https://pypi.python.org/pypi/deskapi\n.. _pip: http://pip-installer.org/\n.. _requests: https://pypi.python.org/pypi/requests\n\n\nGetting Started\n===============\n\nAccess to the Desk API is managed through a ``DeskSession`` object.\nTo instantiate a session, you'll need a sitename and authentication\ninformation. If your Desk.com site is http://example.desk.com, your\nsite name will be ``example``. Authentication information is any `valid\nRequests auth object`_. The simplest thing to provide is a username\nand password. For example::\n\n >>> from deskapi.models import DeskSession\n\n >>> session = DeskSession(\n ... sitename='example',\n ... auth=('nathan@example.com', '53kr17')\n ... )\n\nOnce you have a session ID, you can retrieve a list of Articles_::\n\n >>> articles = session.articles()\n\n`Article fields`_ map to Python properties::\n\n >>> article = articles[0]\n >>> article.subject\n 'Help Topic'\n >>> article.in_support_center\n True\n\nCollections and Objects\n=======================\n\ndeskapi models the information available from Desk API as a set of\n\"collections\" and \"objects\". The ``articles()`` method on\n``DeskSesssion`` returns a *collection*. Collections can be iterated\nover, and support indexed access. A collection can create new members\nin itself.\n\nEach member of a collection is a Desk Object. Desk Objects support\nproperty access to their fields, as well as updating those fields.\n\nCollections\n-----------\n\nCreating Members\n~~~~~~~~~~~~~~~~\n\nYou can create new members of a collection by calling the ``create``\nmethod on it, passing in fields as keyword arguments.\n\n::\n\n >>> new_article = articles.create(\n ... title='New Article',\n ... body='Some content.',\n ... )\n\nArticles\n~~~~~~~~\n\nArticles_ are accessible via the ``articles()`` method on the\n``DeskSession``.\n\n::\n\n >>> articles = session.articles()\n\nTopics\n~~~~~~\n\nTopics_ are accessible via the ``topics()`` method on the ``DeskSession``.\n\nTranslations\n~~~~~~~~~~~~\n\nTranslations_ are accessible via the ``translations`` property of\nArticle objects. The translations collection is slightly different\nthan other collections. Instead of allowing indexed access, it acts\nlike a ``dict``, keyed by locale::\n\n >>> translations = article.translations\n >>> len(translations)\n 2\n >>> translations['es'].subject\n 'Tema de Ayuda'\n\n\n.. _`valid Requests auth object`: http://docs.python-requests.org/en/latest/user/authentication/\n.. _Articles: http://dev.desk.com/API/articles/\n.. _`Article fields`: http://dev.desk.com/API/articles/#show\n.. _Translations: http://dev.desk.com/API/articles/#translations-show\n.. _Topics: http://dev.desk.com/API/topics/\n\nObjects\n-------\n\nUpdating Objects\n~~~~~~~~~~~~~~~~\n\nYou can make changes to an object and save those back to desk.\n\n::\n\n >>> article.body = 'Test Content'\n >>> article.save()\n\nAlternately you can use the ``update`` method to update the\ninformation in Desk *without* updating the local Python object. The\nfollowing is equivalent to the ``save`` example::\n\n >>> article = article.update(body='Test Content')\n\nBoth ``save`` and ``update`` return the updated object.\n\n\nLicense\n=======\n\nMade available under a BSD license; see LICENSE for details.\n\n\nNews\n====\n\n0.1\n---\n\n*Release date: 5 September 2013*\n\n* Initial release\n* Support for Articles, Topics, Translations", "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/eventbrite/deskapi", "keywords": "", "license": "BSD", "maintainer": null, "maintainer_email": null, "name": "deskapi", "package_url": "https://pypi.org/project/deskapi/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/deskapi/", "project_urls": { "Download": "UNKNOWN", "Homepage": "https://github.com/eventbrite/deskapi" }, "release_url": "https://pypi.org/project/deskapi/0.1/", "requires_dist": null, "requires_python": null, "summary": "UNKNOWN", "version": "0.1" }, "last_serial": 858137, "releases": { "0.1": [ { "comment_text": "", "digests": { "md5": "cda6c5cfaeb79106aebe93088023fad8", "sha256": "d8e80c3afaa5c51e8802676506b0bf7fc0711dbd358698a888526ebde5faa8d6" }, "downloads": -1, "filename": "deskapi-0.1.tar.gz", "has_sig": false, "md5_digest": "cda6c5cfaeb79106aebe93088023fad8", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6528, "upload_time": "2013-09-05T18:55:26", "url": "https://files.pythonhosted.org/packages/20/2e/41f32bf08c7abfbca078f62134c24fe5a8fbe9cff5d865ff21a15b877cdc/deskapi-0.1.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "cda6c5cfaeb79106aebe93088023fad8", "sha256": "d8e80c3afaa5c51e8802676506b0bf7fc0711dbd358698a888526ebde5faa8d6" }, "downloads": -1, "filename": "deskapi-0.1.tar.gz", "has_sig": false, "md5_digest": "cda6c5cfaeb79106aebe93088023fad8", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6528, "upload_time": "2013-09-05T18:55:26", "url": "https://files.pythonhosted.org/packages/20/2e/41f32bf08c7abfbca078f62134c24fe5a8fbe9cff5d865ff21a15b877cdc/deskapi-0.1.tar.gz" } ] }