Skip to content

Instantly share code, notes, and snippets.

@dylanjbarth
Created October 17, 2013 23:10
Show Gist options
  • Save dylanjbarth/7033925 to your computer and use it in GitHub Desktop.
Save dylanjbarth/7033925 to your computer and use it in GitHub Desktop.
Introduction to using the Trello API and trello Python package.
import logging
import requests
# Learn how to get your TRELLO_APP_KEY and TOKEN information! https://trello.com/docs/
def archive_all_done_cards(list_id="exampleexampleexample"):
"""Archive all cards in trello 'done' list"""
# python trello package doesn't support this so using requests the old fashioned way
try:
r = requests.post(url="https://api.trello.com/1/lists/%s/archiveAllCards?key=%s&token=%s" %(list_id, TRELLO_APP_KEY, TOKEN))
r.raise_for_status()
except Exception as e:
print e
# Get the list_id by examining your board - the board id is in the URL
# something like GET api.trello.com/1/boards/[board_id]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment