This is a pre-production deployment of Warehouse, however changes made here WILL affect the production instance of PyPI.
Latest Version Dependencies status unknown Test status unknown Test coverage unknown
Project Description

deskapi is a Python wrapper around the REST API. It provides Python wrappers for articles, topics, and translations. deskapi is compatible with Python 2.6, 2.7, and 3.3.


deskapi is installable from PyPI with easy_install or pip.

$ pip install deskapi

This will download the latest release, along with requests, which it depends on.

Getting Started

Access to the Desk API is managed through a DeskSession object. To instantiate a session, you’ll need a sitename and authentication information. If your site is, your site name will be example. Authentication information is any valid Requests auth object. The simplest thing to provide is a username and password. For example:

>>> from deskapi.models import DeskSession

>>> session = DeskSession(
...     sitename='example',
...     auth=('', '53kr17')
... )

Once you have a session ID, you can retrieve a list of Articles:

>>> articles = session.articles()

Article fields map to Python properties:

>>> article = articles[0]
>>> article.subject
'Help Topic'
>>> article.in_support_center

Collections and Objects

deskapi models the information available from Desk API as a set of “collections” and “objects”. The articles() method on DeskSesssion returns a collection. Collections can be iterated over, and support indexed access. A collection can create new members in itself.

Each member of a collection is a Desk Object. Desk Objects support property access to their fields, as well as updating those fields.


Creating Members

You can create new members of a collection by calling the create method on it, passing in fields as keyword arguments.

>>> new_article = articles.create(
...     title='New Article',
...     body='Some content.',
... )


Articles are accessible via the articles() method on the DeskSession.

>>> articles = session.articles()


Topics are accessible via the topics() method on the DeskSession.


Translations are accessible via the translations property of Article objects. The translations collection is slightly different than other collections. Instead of allowing indexed access, it acts like a dict, keyed by locale:

>>> translations = article.translations
>>> len(translations)
>>> translations['es'].subject
'Tema de Ayuda'


Updating Objects

You can make changes to an object and save those back to desk.

>>> article.body = 'Test Content'

Alternately you can use the update method to update the information in Desk without updating the local Python object. The following is equivalent to the save example:

>>> article = article.update(body='Test Content')

Both save and update return the updated object.


Made available under a BSD license; see LICENSE for details.



Release date: 5 September 2013

  • Initial release
  • Support for Articles, Topics, Translations
Release History

Release History


This version

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

Download Files

Download Files

TODO: Brief introduction on what you do with files - including link to relevant help section.

File Name & Checksum SHA256 Checksum Help Version File Type Upload Date
deskapi-0.1.tar.gz (6.5 kB) Copy SHA256 Checksum SHA256 Source Sep 5, 2013

Supported By

WebFaction WebFaction Technical Writing Elastic Elastic Search Pingdom Pingdom Monitoring Dyn Dyn DNS Sentry Sentry Error Logging CloudAMQP CloudAMQP RabbitMQ Heroku Heroku PaaS Kabu Creative Kabu Creative UX & Design Fastly Fastly CDN DigiCert DigiCert EV Certificate Rackspace Rackspace Cloud Servers DreamHost DreamHost Log Hosting