Skip to main content

A Python library for working with the Trello api.

Project description

Meet Trollop

Trollop is a Python library for working with the Trello API.

Quick Start

A Trello connection is instantiated with your API key and a user’s oauth token:

In [1]: from trollop import TrelloConnection

In [2]: conn = TrelloConnection(<your developer key>, <user's oauth token>)

The connection object will automatically have a Member object attached, representing the user whose oauth token was used to connect:

In [3]: conn.me
Out[3]: <trollop.lib.Member object at 0x101707650>

In [4]: conn.me.username
Out[4]: u'btubbs'

In the previous example no HTTP request was made until command 4, the access to conn.me.username. Trollop objects are lazy.

The connection object has methods for getting objects by their IDs. The objects will have attributes named exactly as they are in the Trello API docs.:

In [5]: card = conn.get_card('4f2e454cefab2bbd4ea71b02')

In [6]: card.name
Out[6]: u'Build a Python Trello Library'

In [7]: card.desc
Out[7]: u'And call it Trollop.'

In [8]: card.idList
Out[8]: u'4f17cb04d5c817032301c179'

In addition, there are convenience properties to automatically look up related objects.:

In [9]: lst = card.list

In [10]: lst
Out[10]: <trollop.lib.List object at 0x101707890>

In [11]: lst.name
Out[11]: u'Icebox'

In [12]: lst.id
Out[12]: u'4f17cb04d5c817032301c179'

In [13]: len(lst.cards)
Out[13]: 20

In [14]: lst.cards[-1].name
Out[14]: u'Build a Python Trello Library'

Help Wanted

Some objects are not yet implemented (e.g. actions), as well as some relations between objects. They’re easy to add though; just take a look at the already-implemented classes in trollop/lib.py to see how to declare a new class, attribute, or relation. If you’d like to pitch in to finish covering the whole API, please send a pull request with your changes.

License

Trollop is licensed under the MIT License.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

trollop-0.0.2.tar.gz (5.5 kB view details)

Uploaded Source

File details

Details for the file trollop-0.0.2.tar.gz.

File metadata

  • Download URL: trollop-0.0.2.tar.gz
  • Upload date:
  • Size: 5.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for trollop-0.0.2.tar.gz
Algorithm Hash digest
SHA256 4b8e03ae68369cdd4ef40c11c89c213cc42e2c42888fbe5c1604cc25124de5c1
MD5 f0de379e03c9d24366a7d66d1b1ddbcc
BLAKE2b-256 4b0111a038acb78d0e22620b5c10e0ee516ec4a2d436b7720d81540964c071b8

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page