Created
October 17, 2013 23:10
-
-
Save dylanjbarth/7033925 to your computer and use it in GitHub Desktop.
Introduction to using the Trello API and trello Python package.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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