Async Trello library
Project description
aiotrello
Async Trello Python library
Installation
Install with pip
$ pip install aiotrello
Examples
import asyncio; loop = asyncio.get_event_loop()
from aiotrello import Trello
trello = Trello(key="123", token="abc123") # Initialize a new Trello client
async def main():
# Create 10 boards and make a list for each
for i in range(10):
board = await trello.create_board(f"Board {i}")
await board.create_list("My List")
# Delete all boards that start with "Board"
for board in await trello.get_boards():
if board.name.startswith("Board"):
await board.delete()
# Get a board and list, then make a new card, and finally, add a comment to it
my_board = await trello.get_board(lambda b: b.id == "123")
my_list = await my_board.get_list(lambda l: l.name == "My List")
card = await my_list.create_card("Hello World", "Here is my awesome card")
await card.add_comment("aiotrello rocks!")
# Move card (above example) to a different list
my_other_list = await my_board.get_list(lambda l: l.name == "My Other List")
await card.move_to(my_other_list)
# also supports moving to external boards
board2 = await trello.get_board(lambda b: b.name == "My Other Board")
list2 = await board2.get_list(lambda l: l.name == "My Other List")
await card.move_to(list2, board2)
# Edit a card (above), archive it, and then delete it
await card.edit(name="This card will be deleted soon..")
await card.archive()
await card.delete()
try:
loop.run_until_complete(main())
finally:
loop.run_until_complete(trello.session.close()) # Remember to close the session!
Support
Join our Discord Server
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
aiotrello-0.0.7.7.tar.gz
(6.3 kB
view details)
Built Distribution
File details
Details for the file aiotrello-0.0.7.7.tar.gz
.
File metadata
- Download URL: aiotrello-0.0.7.7.tar.gz
- Upload date:
- Size: 6.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.13.0 pkginfo/1.4.2 requests/2.20.0 setuptools/39.0.1 requests-toolbelt/0.8.0 tqdm/4.28.1 CPython/3.6.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2824ebf32bee96698f72d19818882f8f814409ee63d36191f65975f6827e35ec |
|
MD5 | fa84baa66ad3f18b2731b261e8c3d9ba |
|
BLAKE2b-256 | f7cad7c8a240593772615b6700546487c322e3e6a8689f60c3a821b31cf82336 |
File details
Details for the file aiotrello-0.0.7.7-py3-none-any.whl
.
File metadata
- Download URL: aiotrello-0.0.7.7-py3-none-any.whl
- Upload date:
- Size: 10.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.13.0 pkginfo/1.4.2 requests/2.20.0 setuptools/39.0.1 requests-toolbelt/0.8.0 tqdm/4.28.1 CPython/3.6.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | d0bf5c0adadfe829e9f75e073059c0e67ed380001decd773cd2c97786e524ccf |
|
MD5 | 8eb9602fa1306335ab59b7368d9c3cf9 |
|
BLAKE2b-256 | 00c36170283c63c4a1a828a196789564acba4e1fe91557c8862d62792fe869d1 |