Skip to content

Instantly share code, notes, and snippets.

@dirkk0
Created March 11, 2015 17:52
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dirkk0/321399c9a3e6de301fc0 to your computer and use it in GitHub Desktop.
Save dirkk0/321399c9a3e6de301fc0 to your computer and use it in GitHub Desktop.
Read Trello API by board, list, card
# 1.py
# pip2 install trello
# https://pythonhosted.org/trello/trello.html
import pprint
pp = pprint.PrettyPrinter(indent=4)
import credentials
key = credentials.key
sec = credentials.sec
tok = credentials.tok
boardid = credentials.boardid
from trello import TrelloApi
trello = TrelloApi(key)
# print trello.get_token_url('DirkApp', expires='30days', write_access=True)
trello.set_token(tok)
obj = trello.boards.get(boardid)
obj = trello.boards.get_card(boardid)
print '=== members'
mbr = trello.boards.get_member(boardid)
for i in mbr:
print i['id'], i['username']
print '=== lists'
lst = trello.boards.get_list(boardid)
for i in lst:
print " ", i['id'], i['name']
l = i['id']
crd = trello.lists.get_card(l)
for i in crd:
print " ", i['id'], i['name']
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment