Package: trello-python
trello-pythontrello-pythonis an API wrapper for Trello, written in Python.This library uses Oauth2 for authentication and notifications using webhooks.Installingpip install trello-pythonUsagefromtrello.clientimportClientclient=Client(api_key,token=None)If you don't have a token, follow this instructions:Get authorization URL to obtain tokenurl=client.authorization_url(return_url)Set access tokenclient.set_token(access_token)Check more information about Trello Oauth:https://developer.atlassian.com/cloud/trello/guides/rest-api/authorization/Get current useruser=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 objectworkspace=client.get_workspaces(member_id,filter=None,fields=None,paid_accounts=None)- List Workspace Membersmembers=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 \nboards=client.get_boards(workspace_id,filter=None,fields=None)BoardsGet boardboard=client.get_board(board_id)- List board cards# limit = maximum: 1000cards=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 fieldslists=client.get_board_lists(board_id,cards=None,filter=None,fields=None)- List board labels# limit = default: 50, maximum: 1000labels=client.get_board_labels(board_id,limit=None)- Create label# color = Valid values: yellow, purple, blue, red, green, orange, black, sky, pink, limelabel=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 cardlabel=client.add_label_to_card(card_id,label_id)- Add comment to cardcomment=client.add_comment_to_card(card_id,comment_text)- List card actions# action_type = A comma-separated list of action types. Default: commentCardactions=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,poschecklists=client.get_card_checklists(card_id,fields=None)- List card custom fieldscustom_fields=client.get_card_customfields(card_id)- Get custom fieldcustom_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 webhookswebhooks=client.get_token_webhooks()- Create webhookwebhook=client.create_webhook(idModel,callbackURL,description=None,active=True)Delete webhookclient.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 querysearch=client.search(query,modelTypes=None,partial=None)