trello-python
trello-python is an API wrapper for Trello, written in Python.
This library uses Oauth2 for authentication and notifications using webhooks.
Installing
pip install trello-python
Usage
from trello.client import Client
client = Client(api_key, token=None)
If you don't have a token, follow this instructions:
- Get authorization URL to obtain token
url = client.authorization_url(return_url)
- Set access token
client.set_token(access_token)
Check more information about Trello Oauth: https://developer.atlassian.com/cloud/trello/guides/rest-api/authorization/
Get current user
user = client.get_current_user()
Workspaces
- List Workspaces
# filter = One of: all, members, none, public (Note: members filters to only private Workspaces)
# fields = all or a comma-separated list of organization fields
# paid_accounts = Whether or not to include paid account information in the returned workspace object
workspace = client.get_workspaces(member_id, filter=None, fields=None, paid_accounts=None)
- List Workspace Members
members = client.get_members(workspace_id)
- List Workspace boards
# filter = One of: all, members, none, public (Note: members filters to only private Workspaces) \n
# fields = all or a comma-separated list of organization fields \n
boards = client.get_boards(workspace_id, filter=None, fields=None)
Boards
Get board
board = client.get_board(board_id)
- List board cards
# limit = maximum: 1000
cards = client.get_cards(board_id, limit=None)
- List board lists
# cards = Valid values: all, closed, none, open
# filter = Valid values: all, closed, none, open
# fields = all or a comma-separated list of list fields
lists = client.get_board_lists(board_id, cards=None, filter=None, fields=None)
- List board labels
# limit = default: 50, maximum: 1000
labels = client.get_board_labels(board_id, limit=None)
- Create label
# color = Valid values: yellow, purple, blue, red, green, orange, black, sky, pink, lime
label = client.create_label(board_id, name, color=None)
Cards
- Create Card
# pos: The position of the new card. top, bottom, or a positive float
# due, start: these params accept only isoformat dates.
# idMembers, idLabels: string with a list of ids separated by commas.
card = client.create_card(
idList,
name=None,
desc=None,
pos=None,
due=None,
start=None,
dueComplete=None,
idMembers=None,
idLabels=None,
urlSource=None
)
- Add label to card
label = client.add_label_to_card(card_id, label_id)
- Add comment to card
comment = client.add_comment_to_card(card_id, comment_text)
- List card actions
# action_type = A comma-separated list of action types. Default: commentCard
actions = client.get_card_actions(card_id, action_type=None, page=None)
A list of action types here: https://developer.atlassian.com/cloud/trello/guides/rest-api/action-types/
- List card checklists
# fields = all or a comma-separated list of: idBoard,idCard,name,pos
checklists = client.get_card_checklists(card_id, fields=None)
- List card custom fields
custom_fields = client.get_card_customfields(card_id)
- Get custom field
custom_field = client.get_customfield(customfield_id)
Checklists
- Add item to checklist
# pos = The position of the check item in the checklist. One of: top, bottom, or a positive number.
# due, dueReminder: these params accept only isoformat dates.
item = client.add_item_to_checklist(checklist_id, name, pos=None, checked=None, due=None, dueReminder=None, idMember=None)
Webhooks
- List token webhooks
webhooks = client.get_token_webhooks()
- Create webhook
webhook = client.create_webhook(idModel, callbackURL, description=None, active=True)
Delete webhook
client.delete_webhook(webhook_id)
Search
# modelTypes = all or a comma-separated list of: actions, boards, cards, members, organizations. Default all.
# partial = true means that it will look for content that starts with any of the words in your query
search = client.search(query, modelTypes=None, partial=None)
Metadata
Release files for trello-python 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| trello_python-0.1.0.tar.gz | 4.8 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| trello_python-0.1.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 10.7 kB
Release files / trello_python-0.1.0.tar.gz
| Download URL | trello_python-0.1.0.tar.gz |
|---|---|
| Size | 4.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
8bbc7181a55ef7ef5a3865b666811e1000c7eb0df2b273f16c65a18bb7f27134
|
|
BLAKE2b-256 checksum How to use checksums |
e7259f05e485137dd16f8be00de548c94e9c1160788746520cde9aaea7ea9335
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.10.9
|
Release files / trello_python-0.1.0-py3-none-any.whl
| Download URL | trello_python-0.1.0-py3-none-any.whl |
|---|---|
| Size | 5.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
478c2fdfb4b99fdca67264d4372cd49f09cceadf122cd2521741be485901182e
|
|
BLAKE2b-256 checksum How to use checksums |
1fafd44fa5e708064ce7a98f6ed4dd94f876102025a35d3c4c0b0e83e78d40e9
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.10.9
|
Security for trello-python 0.1.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.