M trello/__init__.py +3 -0
@@ 8,6 8,7 @@ from .members import Members
from .notifications import Notifications
from .organizations import Organizations
from .tokens import Tokens
+from .types import Types
class TrelloApi(object):
@@ 23,6 24,7 @@ class TrelloApi(object):
self.notifications = Notifications(apikey, token)
self.organizations = Organizations(apikey, token)
self.tokens = Tokens(apikey, token)
+ self.types = Types(apikey, token)
def set_token(self, token):
@@ 36,6 38,7 @@ class TrelloApi(object):
self.notifications._token = token
self.organizations._token = token
self.tokens._token = token
+ self.types._token = token
def get_token_url(self, app_name, expires='30days', write_access=True):
M trello/actions.py +2 -2
@@ 6,8 6,8 @@ class Actions(object):
self._apikey = apikey
self._token = token
- def get(self, action_id, fields=None):
- resp = requests.get("https://trello.com/1/actions/%s" % (action_id), params=dict(key=self._apikey, token=self._token, fields=fields), data=None)
+ def get(self, action_id, fields=None, member=None, member_fields=None, memberCreator=None, memberCreator_fields=None):
+ resp = requests.get("https://trello.com/1/actions/%s" % (action_id), params=dict(key=self._apikey, token=self._token, fields=fields, member=member, member_fields=member_fields, memberCreator=memberCreator, memberCreator_fields=memberCreator_fields), data=None)
resp.raise_for_status()
return json.loads(resp.content)
M trello/boards.py +28 -8
@@ 6,8 6,8 @@ class Boards(object):
self._apikey = apikey
self._token = token
- def get(self, board_id, actions=None, action_fields=None, action_limit=None, cards=None, card_fields=None, lists=None, list_fields=None, members=None, member_fields=None, checklists=None, checklist_fields=None, organization=None, organization_fields=None, fields=None):
- resp = requests.get("https://trello.com/1/boards/%s" % (board_id), params=dict(key=self._apikey, token=self._token, actions=actions, action_fields=action_fields, action_limit=action_limit, cards=cards, card_fields=card_fields, lists=lists, list_fields=list_fields, members=members, member_fields=member_fields, checklists=checklists, checklist_fields=checklist_fields, organization=organization, organization_fields=organization_fields, fields=fields), data=None)
+ def get(self, board_id, actions=None, action_fields=None, action_limit=None, cards=None, card_fields=None, lists=None, list_fields=None, members=None, member_fields=None, membersInvited=None, membersInvited_fields=None, checklists=None, checklist_fields=None, organization=None, organization_fields=None, myPrefs=None, fields=None):
+ resp = requests.get("https://trello.com/1/boards/%s" % (board_id), params=dict(key=self._apikey, token=self._token, actions=actions, action_fields=action_fields, action_limit=action_limit, cards=cards, card_fields=card_fields, lists=lists, list_fields=list_fields, members=members, member_fields=member_fields, membersInvited=membersInvited, membersInvited_fields=membersInvited_fields, checklists=checklists, checklist_fields=checklist_fields, organization=organization, organization_fields=organization_fields, myPrefs=myPrefs, fields=fields), data=None)
resp.raise_for_status()
return json.loads(resp.content)
@@ 16,13 16,13 @@ class Boards(object):
resp.raise_for_status()
return json.loads(resp.content)
- def get_action(self, board_id, filter=None, fields=None, limit=None, page=None):
- resp = requests.get("https://trello.com/1/boards/%s/actions" % (board_id), params=dict(key=self._apikey, token=self._token, filter=filter, fields=fields, limit=limit, page=page), data=None)
+ def get_action(self, board_id, filter=None, fields=None, limit=None, page=None, idModels=None):
+ resp = requests.get("https://trello.com/1/boards/%s/actions" % (board_id), params=dict(key=self._apikey, token=self._token, filter=filter, fields=fields, limit=limit, page=page, idModels=idModels), data=None)
resp.raise_for_status()
return json.loads(resp.content)
- def get_card(self, board_id, actions=None, attachments=None, members=None, checkItemStates=None, badges=None, labels=None, checklists=None, filter=None, fields=None):
- resp = requests.get("https://trello.com/1/boards/%s/cards" % (board_id), params=dict(key=self._apikey, token=self._token, actions=actions, attachments=attachments, members=members, checkItemStates=checkItemStates, badges=badges, labels=labels, checklists=checklists, filter=filter, fields=fields), data=None)
+ def get_card(self, board_id, actions=None, attachments=None, members=None, checkItemStates=None, checklists=None, filter=None, fields=None):
+ resp = requests.get("https://trello.com/1/boards/%s/cards" % (board_id), params=dict(key=self._apikey, token=self._token, actions=actions, attachments=attachments, members=members, checkItemStates=checkItemStates, checklists=checklists, filter=filter, fields=fields), data=None)
resp.raise_for_status()
return json.loads(resp.content)
@@ 31,8 31,8 @@ class Boards(object):
resp.raise_for_status()
return json.loads(resp.content)
- def get_card_idCard(self, idCard, board_id, actions=None, action_fields=None, action_limit=None, members=None, member_fields=None, checkItemStates=None, checkItemState_fields=None, badges=None, labels=None, checklists=None, checklist_fields=None, fields=None):
- resp = requests.get("https://trello.com/1/boards/%s/cards/%s" % (board_id, idCard), params=dict(key=self._apikey, token=self._token, actions=actions, action_fields=action_fields, action_limit=action_limit, members=members, member_fields=member_fields, checkItemStates=checkItemStates, checkItemState_fields=checkItemState_fields, badges=badges, labels=labels, checklists=checklists, checklist_fields=checklist_fields, fields=fields), data=None)
+ def get_card_idCard(self, idCard, board_id, actions=None, action_fields=None, action_limit=None, members=None, member_fields=None, checkItemStates=None, checkItemState_fields=None, labels=None, checklists=None, checklist_fields=None, fields=None):
+ resp = requests.get("https://trello.com/1/boards/%s/cards/%s" % (board_id, idCard), params=dict(key=self._apikey, token=self._token, actions=actions, action_fields=action_fields, action_limit=action_limit, members=members, member_fields=member_fields, checkItemStates=checkItemStates, checkItemState_fields=checkItemState_fields, labels=labels, checklists=checklists, checklist_fields=checklist_fields, fields=fields), data=None)
resp.raise_for_status()
return json.loads(resp.content)
@@ 61,6 61,21 @@ class Boards(object):
resp.raise_for_status()
return json.loads(resp.content)
+ def get_membersInvited(self, board_id, fields=None):
+ resp = requests.get("https://trello.com/1/boards/%s/membersInvited" % (board_id), params=dict(key=self._apikey, token=self._token, fields=fields), data=None)
+ resp.raise_for_status()
+ return json.loads(resp.content)
+
+ def get_membersInvited_field(self, field, board_id):
+ resp = requests.get("https://trello.com/1/boards/%s/membersInvited/%s" % (board_id, field), params=dict(key=self._apikey, token=self._token), data=None)
+ resp.raise_for_status()
+ return json.loads(resp.content)
+
+ def get_myPref(self, board_id):
+ resp = requests.get("https://trello.com/1/boards/%s/myPrefs" % (board_id), params=dict(key=self._apikey, token=self._token), data=None)
+ resp.raise_for_status()
+ return json.loads(resp.content)
+
def get_organization(self, board_id, fields=None):
resp = requests.get("https://trello.com/1/boards/%s/organization" % (board_id), params=dict(key=self._apikey, token=self._token, fields=fields), data=None)
resp.raise_for_status()
@@ 106,4 121,9 @@ class Boards(object):
resp.raise_for_status()
return json.loads(resp.content)
+ def new_myPref(self, board_id, name, value):
+ resp = requests.post("https://trello.com/1/boards/%s/myPrefs" % (board_id), params=dict(key=self._apikey, token=self._token), data=dict(name=name, value=value))
+ resp.raise_for_status()
+ return json.loads(resp.content)
+
M trello/cards.py +14 -14
@@ 6,8 6,8 @@ class Cards(object):
self._apikey = apikey
self._token = token
- def get(self, card_id, actions=None, action_fields=None, action_limit=None, attachments=None, attachment_fields=None, members=None, member_fields=None, checkItemStates=None, checkItemState_fields=None, badges=None, labels=None, checklists=None, checklist_fields=None, fields=None):
- resp = requests.get("https://trello.com/1/cards/%s" % (card_id), params=dict(key=self._apikey, token=self._token, actions=actions, action_fields=action_fields, action_limit=action_limit, attachments=attachments, attachment_fields=attachment_fields, members=members, member_fields=member_fields, checkItemStates=checkItemStates, checkItemState_fields=checkItemState_fields, badges=badges, labels=labels, checklists=checklists, checklist_fields=checklist_fields, fields=fields), data=None)
+ def get(self, card_id, actions=None, action_fields=None, action_limit=None, attachments=None, attachment_fields=None, members=None, member_fields=None, checkItemStates=None, checkItemState_fields=None, checklists=None, checklist_fields=None, fields=None):
+ resp = requests.get("https://trello.com/1/cards/%s" % (card_id), params=dict(key=self._apikey, token=self._token, actions=actions, action_fields=action_fields, action_limit=action_limit, attachments=attachments, attachment_fields=attachment_fields, members=members, member_fields=member_fields, checkItemStates=checkItemStates, checkItemState_fields=checkItemState_fields, checklists=checklists, checklist_fields=checklist_fields, fields=fields), data=None)
resp.raise_for_status()
return json.loads(resp.content)
@@ 16,8 16,8 @@ class Cards(object):
resp.raise_for_status()
return json.loads(resp.content)
- def get_action(self, card_id, filter=None, fields=None, limit=None, page=None):
- resp = requests.get("https://trello.com/1/cards/%s/actions" % (card_id), params=dict(key=self._apikey, token=self._token, filter=filter, fields=fields, limit=limit, page=page), data=None)
+ def get_action(self, card_id, filter=None, fields=None, limit=None, page=None, idModels=None):
+ resp = requests.get("https://trello.com/1/cards/%s/actions" % (card_id), params=dict(key=self._apikey, token=self._token, filter=filter, fields=fields, limit=limit, page=page, idModels=idModels), data=None)
resp.raise_for_status()
return json.loads(resp.content)
@@ 26,11 26,6 @@ class Cards(object):
resp.raise_for_status()
return json.loads(resp.content)
- def get_badge(self, card_id):
- resp = requests.get("https://trello.com/1/cards/%s/badges" % (card_id), params=dict(key=self._apikey, token=self._token), data=None)
- resp.raise_for_status()
- return json.loads(resp.content)
-
def get_board(self, card_id, fields=None):
resp = requests.get("https://trello.com/1/cards/%s/board" % (card_id), params=dict(key=self._apikey, token=self._token, fields=fields), data=None)
resp.raise_for_status()
@@ 51,11 46,6 @@ class Cards(object):
resp.raise_for_status()
return json.loads(resp.content)
- def get_label(self, card_id):
- resp = requests.get("https://trello.com/1/cards/%s/labels" % (card_id), params=dict(key=self._apikey, token=self._token), data=None)
- resp.raise_for_status()
- return json.loads(resp.content)
-
def get_list(self, card_id, fields=None):
resp = requests.get("https://trello.com/1/cards/%s/list" % (card_id), params=dict(key=self._apikey, token=self._token, fields=fields), data=None)
resp.raise_for_status()
@@ 131,6 121,11 @@ class Cards(object):
resp.raise_for_status()
return json.loads(resp.content)
+ def new_membersVoted(self, card_id, value):
+ resp = requests.post("https://trello.com/1/cards/%s/membersVoted" % (card_id), params=dict(key=self._apikey, token=self._token), data=dict(value=value))
+ resp.raise_for_status()
+ return json.loads(resp.content)
+
def delete(self, card_id):
resp = requests.delete("https://trello.com/1/cards/%s" % (card_id), params=dict(key=self._apikey, token=self._token), data=None)
resp.raise_for_status()
@@ 151,4 146,9 @@ class Cards(object):
resp.raise_for_status()
return json.loads(resp.content)
+ def delete_membersVoted_idMember(self, idMember, card_id):
+ resp = requests.delete("https://trello.com/1/cards/%s/membersVoted/%s" % (card_id, idMember), params=dict(key=self._apikey, token=self._token), data=None)
+ resp.raise_for_status()
+ return json.loads(resp.content)
+
M trello/checklists.py +10 -10
@@ 6,8 6,8 @@ class Checklists(object):
self._apikey = apikey
self._token = token
- def get(self, checklist_id, cards=None, card_fields=None, checkitems=None, checkitem_fields=None, fields=None):
- resp = requests.get("https://trello.com/1/checklists/%s" % (checklist_id), params=dict(key=self._apikey, token=self._token, cards=cards, card_fields=card_fields, checkitems=checkitems, checkitem_fields=checkitem_fields, fields=fields), data=None)
+ def get(self, checklist_id, cards=None, card_fields=None, checkItems=None, checkItem_fields=None, fields=None):
+ resp = requests.get("https://trello.com/1/checklists/%s" % (checklist_id), params=dict(key=self._apikey, token=self._token, cards=cards, card_fields=card_fields, checkItems=checkItems, checkItem_fields=checkItem_fields, fields=fields), data=None)
resp.raise_for_status()
return json.loads(resp.content)
@@ 26,8 26,8 @@ class Checklists(object):
resp.raise_for_status()
return json.loads(resp.content)
- def get_card(self, checklist_id, actions=None, attachments=None, members=None, checkItemStates=None, badges=None, labels=None, checklists=None, filter=None, fields=None):
- resp = requests.get("https://trello.com/1/checklists/%s/cards" % (checklist_id), params=dict(key=self._apikey, token=self._token, actions=actions, attachments=attachments, members=members, checkItemStates=checkItemStates, badges=badges, labels=labels, checklists=checklists, filter=filter, fields=fields), data=None)
+ def get_card(self, checklist_id, actions=None, attachments=None, members=None, checkItemStates=None, checklists=None, filter=None, fields=None):
+ resp = requests.get("https://trello.com/1/checklists/%s/cards" % (checklist_id), params=dict(key=self._apikey, token=self._token, actions=actions, attachments=attachments, members=members, checkItemStates=checkItemStates, checklists=checklists, filter=filter, fields=fields), data=None)
resp.raise_for_status()
return json.loads(resp.content)
@@ 36,8 36,8 @@ class Checklists(object):
resp.raise_for_status()
return json.loads(resp.content)
- def get_checkitem(self, checklist_id, filter=None, fields=None):
- resp = requests.get("https://trello.com/1/checklists/%s/checkitems" % (checklist_id), params=dict(key=self._apikey, token=self._token, filter=filter, fields=fields), data=None)
+ def get_checkItem(self, checklist_id, filter=None, fields=None):
+ resp = requests.get("https://trello.com/1/checklists/%s/checkItems" % (checklist_id), params=dict(key=self._apikey, token=self._token, filter=filter, fields=fields), data=None)
resp.raise_for_status()
return json.loads(resp.content)
@@ 56,13 56,13 @@ class Checklists(object):
resp.raise_for_status()
return json.loads(resp.content)
- def new_checkitem(self, checklist_id, name):
- resp = requests.post("https://trello.com/1/checklists/%s/checkitems" % (checklist_id), params=dict(key=self._apikey, token=self._token), data=dict(name=name))
+ def new_checkItem(self, checklist_id, name):
+ resp = requests.post("https://trello.com/1/checklists/%s/checkItems" % (checklist_id), params=dict(key=self._apikey, token=self._token), data=dict(name=name))
resp.raise_for_status()
return json.loads(resp.content)
- def delete_checkitem_idCheckItem(self, idCheckItem, checklist_id):
- resp = requests.delete("https://trello.com/1/checklists/%s/checkitems/%s" % (checklist_id, idCheckItem), params=dict(key=self._apikey, token=self._token), data=None)
+ def delete_checkItem_idCheckItem(self, idCheckItem, checklist_id):
+ resp = requests.delete("https://trello.com/1/checklists/%s/checkItems/%s" % (checklist_id, idCheckItem), params=dict(key=self._apikey, token=self._token), data=None)
resp.raise_for_status()
return json.loads(resp.content)
M trello/lists.py +4 -4
@@ 16,8 16,8 @@ class Lists(object):
resp.raise_for_status()
return json.loads(resp.content)
- def get_action(self, list_id, filter=None, fields=None, limit=None, page=None):
- resp = requests.get("https://trello.com/1/lists/%s/actions" % (list_id), params=dict(key=self._apikey, token=self._token, filter=filter, fields=fields, limit=limit, page=page), data=None)
+ def get_action(self, list_id, filter=None, fields=None, limit=None, page=None, idModels=None):
+ resp = requests.get("https://trello.com/1/lists/%s/actions" % (list_id), params=dict(key=self._apikey, token=self._token, filter=filter, fields=fields, limit=limit, page=page, idModels=idModels), data=None)
resp.raise_for_status()
return json.loads(resp.content)
@@ 31,8 31,8 @@ class Lists(object):
resp.raise_for_status()
return json.loads(resp.content)
- def get_card(self, list_id, actions=None, attachments=None, members=None, checkItemStates=None, badges=None, labels=None, checklists=None, filter=None, fields=None):
- resp = requests.get("https://trello.com/1/lists/%s/cards" % (list_id), params=dict(key=self._apikey, token=self._token, actions=actions, attachments=attachments, members=members, checkItemStates=checkItemStates, badges=badges, labels=labels, checklists=checklists, filter=filter, fields=fields), data=None)
+ def get_card(self, list_id, actions=None, attachments=None, members=None, checkItemStates=None, checklists=None, filter=None, fields=None):
+ resp = requests.get("https://trello.com/1/lists/%s/cards" % (list_id), params=dict(key=self._apikey, token=self._token, actions=actions, attachments=attachments, members=members, checkItemStates=checkItemStates, checklists=checklists, filter=filter, fields=fields), data=None)
resp.raise_for_status()
return json.loads(resp.content)
M trello/members.py +26 -6
@@ 6,8 6,8 @@ class Members(object):
self._apikey = apikey
self._token = token
- def get(self, member_id_or_username, actions=None, action_fields=None, action_limit=None, cards=None, card_fields=None, boards=None, board_fields=None, organizations=None, organization_fields=None, fields=None):
- resp = requests.get("https://trello.com/1/members/%s" % (member_id_or_username), params=dict(key=self._apikey, token=self._token, actions=actions, action_fields=action_fields, action_limit=action_limit, cards=cards, card_fields=card_fields, boards=boards, board_fields=board_fields, organizations=organizations, organization_fields=organization_fields, fields=fields), data=None)
+ def get(self, member_id_or_username, actions=None, action_fields=None, action_limit=None, cards=None, card_fields=None, boards=None, board_fields=None, boardsInvited=None, boardsInvited_fields=None, organizations=None, organization_fields=None, organizationsInvited=None, organizationsInvited_fields=None, notifications=None, notification_fields=None, notification_limit=None, fields=None):
+ resp = requests.get("https://trello.com/1/members/%s" % (member_id_or_username), params=dict(key=self._apikey, token=self._token, actions=actions, action_fields=action_fields, action_limit=action_limit, cards=cards, card_fields=card_fields, boards=boards, board_fields=board_fields, boardsInvited=boardsInvited, boardsInvited_fields=boardsInvited_fields, organizations=organizations, organization_fields=organization_fields, organizationsInvited=organizationsInvited, organizationsInvited_fields=organizationsInvited_fields, notifications=notifications, notification_fields=notification_fields, notification_limit=notification_limit, fields=fields), data=None)
resp.raise_for_status()
return json.loads(resp.content)
@@ 16,8 16,8 @@ class Members(object):
resp.raise_for_status()
return json.loads(resp.content)
- def get_action(self, member_id_or_username, filter=None, fields=None, limit=None, page=None):
- resp = requests.get("https://trello.com/1/members/%s/actions" % (member_id_or_username), params=dict(key=self._apikey, token=self._token, filter=filter, fields=fields, limit=limit, page=page), data=None)
+ def get_action(self, member_id_or_username, filter=None, fields=None, limit=None, page=None, idModels=None):
+ resp = requests.get("https://trello.com/1/members/%s/actions" % (member_id_or_username), params=dict(key=self._apikey, token=self._token, filter=filter, fields=fields, limit=limit, page=page, idModels=idModels), data=None)
resp.raise_for_status()
return json.loads(resp.content)
@@ 31,8 31,18 @@ class Members(object):
resp.raise_for_status()
return json.loads(resp.content)
- def get_card(self, member_id_or_username, actions=None, attachments=None, members=None, checkItemStates=None, badges=None, labels=None, checklists=None, filter=None, fields=None):
- resp = requests.get("https://trello.com/1/members/%s/cards" % (member_id_or_username), params=dict(key=self._apikey, token=self._token, actions=actions, attachments=attachments, members=members, checkItemStates=checkItemStates, badges=badges, labels=labels, checklists=checklists, filter=filter, fields=fields), data=None)
+ def get_boardsInvited(self, member_id_or_username, fields=None):
+ resp = requests.get("https://trello.com/1/members/%s/boardsInvited" % (member_id_or_username), params=dict(key=self._apikey, token=self._token, fields=fields), data=None)
+ resp.raise_for_status()
+ return json.loads(resp.content)
+
+ def get_boardsInvited_field(self, field, member_id_or_username):
+ resp = requests.get("https://trello.com/1/members/%s/boardsInvited/%s" % (member_id_or_username, field), params=dict(key=self._apikey, token=self._token), data=None)
+ resp.raise_for_status()
+ return json.loads(resp.content)
+
+ def get_card(self, member_id_or_username, actions=None, attachments=None, members=None, checkItemStates=None, checklists=None, filter=None, fields=None):
+ resp = requests.get("https://trello.com/1/members/%s/cards" % (member_id_or_username), params=dict(key=self._apikey, token=self._token, actions=actions, attachments=attachments, members=members, checkItemStates=checkItemStates, checklists=checklists, filter=filter, fields=fields), data=None)
resp.raise_for_status()
return json.loads(resp.content)
@@ 61,6 71,16 @@ class Members(object):
resp.raise_for_status()
return json.loads(resp.content)
+ def get_organizationsInvited(self, member_id_or_username, fields=None):
+ resp = requests.get("https://trello.com/1/members/%s/organizationsInvited" % (member_id_or_username), params=dict(key=self._apikey, token=self._token, fields=fields), data=None)
+ resp.raise_for_status()
+ return json.loads(resp.content)
+
+ def get_organizationsInvited_field(self, field, member_id_or_username):
+ resp = requests.get("https://trello.com/1/members/%s/organizationsInvited/%s" % (member_id_or_username, field), params=dict(key=self._apikey, token=self._token), data=None)
+ resp.raise_for_status()
+ return json.loads(resp.content)
+
def update(self, member_id_or_username, fullName=None, initials=None, bio=None):
resp = requests.put("https://trello.com/1/members/%s" % (member_id_or_username), params=dict(key=self._apikey, token=self._token), data=dict(fullName=fullName, initials=initials, bio=bio))
resp.raise_for_status()
M trello/notifications.py +2 -2
@@ 6,8 6,8 @@ class Notifications(object):
self._apikey = apikey
self._token = token
- def get(self, notification_id, fields=None):
- resp = requests.get("https://trello.com/1/notifications/%s" % (notification_id), params=dict(key=self._apikey, token=self._token, fields=fields), data=None)
+ def get(self, notification_id, fields=None, memberCreator=None, memberCreator_fields=None, board=None, board_fields=None, list=None, card=None, card_fields=None, organization=None, organization_fields=None, member=None, member_fields=None):
+ resp = requests.get("https://trello.com/1/notifications/%s" % (notification_id), params=dict(key=self._apikey, token=self._token, fields=fields, memberCreator=memberCreator, memberCreator_fields=memberCreator_fields, board=board, board_fields=board_fields, list=list, card=card, card_fields=card_fields, organization=organization, organization_fields=organization_fields, member=member, member_fields=member_fields), data=None)
resp.raise_for_status()
return json.loads(resp.content)
M trello/organizations.py +37 -2
@@ 16,8 16,8 @@ class Organizations(object):
resp.raise_for_status()
return json.loads(resp.content)
- def get_action(self, org_id_or_name, filter=None, fields=None, limit=None, page=None):
- resp = requests.get("https://trello.com/1/organizations/%s/actions" % (org_id_or_name), params=dict(key=self._apikey, token=self._token, filter=filter, fields=fields, limit=limit, page=page), data=None)
+ def get_action(self, org_id_or_name, filter=None, fields=None, limit=None, page=None, idModels=None):
+ resp = requests.get("https://trello.com/1/organizations/%s/actions" % (org_id_or_name), params=dict(key=self._apikey, token=self._token, filter=filter, fields=fields, limit=limit, page=page, idModels=idModels), data=None)
resp.raise_for_status()
return json.loads(resp.content)
@@ 41,4 41,39 @@ class Organizations(object):
resp.raise_for_status()
return json.loads(resp.content)
+ def update(self, org_id_or_name, name=None, displayName=None, desc=None, website=None):
+ resp = requests.put("https://trello.com/1/organizations/%s" % (org_id_or_name), params=dict(key=self._apikey, token=self._token), data=dict(name=name, displayName=displayName, desc=desc, website=website))
+ resp.raise_for_status()
+ return json.loads(resp.content)
+
+ def update_desc(self, org_id_or_name, value):
+ resp = requests.put("https://trello.com/1/organizations/%s/desc" % (org_id_or_name), params=dict(key=self._apikey, token=self._token), data=dict(value=value))
+ resp.raise_for_status()
+ return json.loads(resp.content)
+
+ def update_displayName(self, org_id_or_name, value):
+ resp = requests.put("https://trello.com/1/organizations/%s/displayName" % (org_id_or_name), params=dict(key=self._apikey, token=self._token), data=dict(value=value))
+ resp.raise_for_status()
+ return json.loads(resp.content)
+
+ def update_name(self, org_id_or_name, value):
+ resp = requests.put("https://trello.com/1/organizations/%s/name" % (org_id_or_name), params=dict(key=self._apikey, token=self._token), data=dict(value=value))
+ resp.raise_for_status()
+ return json.loads(resp.content)
+
+ def update_website(self, org_id_or_name, value):
+ resp = requests.put("https://trello.com/1/organizations/%s/website" % (org_id_or_name), params=dict(key=self._apikey, token=self._token), data=dict(value=value))
+ resp.raise_for_status()
+ return json.loads(resp.content)
+
+ def new(self, name, displayName=None, desc=None, website=None):
+ resp = requests.post("https://trello.com/1/organizations" % (), params=dict(key=self._apikey, token=self._token), data=dict(name=name, displayName=displayName, desc=desc, website=website))
+ resp.raise_for_status()
+ return json.loads(resp.content)
+
+ def delete(self, org_id_or_name):
+ resp = requests.delete("https://trello.com/1/organizations/%s" % (org_id_or_name), params=dict(key=self._apikey, token=self._token), data=None)
+ resp.raise_for_status()
+ return json.loads(resp.content)
+
A => trello/types.py +14 -0
@@ 0,0 1,14 @@
+import json
+import requests
+
+class Types(object):
+ def __init__(self, apikey, token=None):
+ self._apikey = apikey
+ self._token = token
+
+ def get(self, id):
+ resp = requests.get("https://trello.com/1/types/%s" % (id), params=dict(key=self._apikey, token=self._token), data=None)
+ resp.raise_for_status()
+ return json.loads(resp.content)
+
+