Git Product home page Git Product logo

py-trello's People

Contributors

benjmin-r avatar bhrutledge avatar biern avatar brutasse avatar dc23 avatar ddanielvaz avatar delucks avatar diegojromerolopez avatar fabianjs avatar fredericlepied avatar iksteen avatar jean avatar juergenbs avatar kdazzle avatar kennethzfeng avatar larssorenson avatar mazyod avatar naiyt avatar nmustaki avatar portante avatar rdorrigan avatar sarumont avatar sgaynetdinov avatar sveder avatar t0ffel avatar thingable avatar ultrabug avatar vvvvae avatar wolph avatar x0152 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

py-trello's Issues

trello.TrelloClient.list_boards() leads to TypeError

I just tried the module in a simple iPython session but failed:

In [1]: import trello

In [2]: t=trello.TrelloClient('xxx','yyy')

In [3]: t.list_boards()


TypeError Traceback (most recent call last)
in ()
----> 1 t.list_boards()

/home/chaas/projekte/trello/py-trello/trello/init.pyc in list_boards(self)
103 - url: URL to the board
104 """
--> 105 json_obj = self.fetch_json('/members/me/boards/all')
106 boards = list()
107 for obj in json_obj:

/home/chaas/projekte/trello/py-trello/trello/init.pyc in fetch_json(self, uri_path, http_method, headers, query_params, post_args)
145 # error checking
146 if response.status == 401:
--> 147 raise Unauthorized(url)
148 if response.status != 200:
149 raise ResourceUnavailable(url, response)

TypeError: init() takes exactly 3 arguments (2 given)

dateutil ImportError

When I try to download and run this code, I get an ImportError because it can't find the dateutil module. When I download and run the source for the 0.1.6 release, everything works fine.

Unicode handling

In various places py-trello .encode('utf-8') some strings returned by the API.

What's the rationale behind this? Trello data is returned in JSON, with string keys and attributes in unicode strings (u'foo' in Python 2, 'foo' in Python 3).

Keeping unicode would make sense: in Python 2 you can compare bytestrings to unicode strings implicitly (u'foo' == 'foo'), but in Python 3 it'd make more sense to compare e.g. board.name to unicode strings instead of bytestrings. In Python 3 our code needs to re-decode data for comparison or string formatting. We have things like:

if board.name == b'Board name'

or:

message = '{}: {}'.format(board.name.decode(), card.name.decode())

My suggested fix would be to remove all occurrences of .encode('utf-8') here, to have a proper unicode sandwich behavior. Any objections? I'm happy to submit a PR.

Contribution of Card.change_board()

Again, I needed this for my own use, and it's strongly modeled on existing code.

def change_board(self, board_id, list_id = None):
    args = {'value' : board_id, }
    if list_id is not None:
        args['idList'] = list_id
    self.client.fetch_json(
        '/cards/'+self.id+'/idBoard',
        http_method = 'PUT',
        post_args = args)

Feel free to add, edit, whatever.

KeyError in Member due to latest pull request

The latest pull request introduced a bug which makes the library unusable for me:

File "/....../trello/__init__.py", line 917, in fetch
    self.commentCard = json_obj['commentCard']
KeyError: 'commentCard'

Meaningless .encode('utf-8').decode('utf-8') ?

In this commit 11945ea I don't understand why you're decoding what you're encoding, that's meaningless.

The only "side effect" I can see of doing this is to raise an exception when the string is not UTF-8 in the first place (can it be possible ?), yet that's a particularly unreadable way to express "I'm checking for UTF-8 compliance".

Also, I tried to run test/test_board.py (to test with python3 -bb) but your tests won't even start:

======================================================================
ERROR: setUpClass (__main__.TrelloBoardTestCase)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "test/test_board.py", line 24, in setUpClass
    if not cls._board:
AttributeError: type object 'TrelloBoardTestCase' has no attribute '_board'

----------------------------------------------------------------------
Ran 0 tests in 0.300s

Can't Set Attribute/Checklist retrieval

I have a requirement to manipulate checklist items using py-trello. I can't see any method to capture a checklist instance is to create it first. However, whenever I call a method to add anything it works and a new card appears in Trello but nothing is returned by the function and I receive an error message
EG1:
newcard = mylist.add_card('Card Name', 'Card Description')
Traceback (most recent call last):
File "", line 1, in
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site- packages/trello/init.py", line 432, in add_card
card.description = json_obj.get('desc', '')
AttributeError: can't set attribute

EG2:
mychecklist = mycard.add_checklist("Checklist Name", checklistitems)
Traceback (most recent call last):
File "", line 1, in
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site- packages/trello/init.py", line 622, in add_checklist
self.fetch()
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/trello/init.py", line 507, in fetch
self.description = json_obj.get('desc', '')
AttributeError: can't set attribute

This isn't such a problem with the add_card method, as I can write a workaround but as far as I can see, there's no way to get a checklist object without creating it with py-trello first. Any suggestions?

How to post and retrieve comment card data through Trello API?

StackOverflow Original Post

I'm building a web app that pushes and pulls data to/from Trello using its API.

The current stack is pythonic and I use py-trello to manage most of the API calls.
But there's one endpoint leaving me perplex : post a comment on a card

It seems like the current py-trello implementation does not provide a way to post a new comment and immediately retrieve its data. For example, you can do it with a List :

    def add_list(self, name):
        """Add a list to this board
        :name: name for the list
        :return: the list
        :rtype: List
        """
        obj = self.client.fetch_json(
            '/lists',
            http_method='POST',
            post_args={'name': name, 'idBoard': self.id}, )
        return List.from_json(board=self, json_obj=obj)

Trello API return the created list object as a JSON object. py-trello turns this JSON into a List object.

Is there a way to do the same with Card comment? Card class comes with an "add comment" feature (code).

But Trello seems to return nothing...

    >>> # Card definition
    >>> card = Card(parent=trello_board, card_id=id)
    >>> # Fetching card data
    >>> card.fetch()
    >>> # This is correctly pushed to Trello
    >>> obj = card.comment('Foo, bar!')
    >>> import pprint
    >>> # Hoping to print a big fat JSON
    >>> pp = pprint.PrettyPrinter(indent=4)
    >>> pp.pprint(obj)
    None

Any clue ? Thanks alot !

Issue adding checklist items

When I add them, they are added successfully, but then I am seeing a TypeError I have to catch:

  File "/srv/www/cinematique/cin/core/management/commands/test_trello.py", line 55, in handle
    'Cinematique'
  File "/srv/www/cinematique/cin/core/trello_api.py", line 65, in add_checklist_to_card
    checklist = card.add_checklist(name,check_list_items)
  File "/opt/envs/cinematique/local/lib/python2.7/site-packages/trello/__init__.py", line 683, in add_checklist
    self.fetch()
  File "/opt/envs/cinematique/local/lib/python2.7/site-packages/trello/__init__.py", line 577, in fetch
    self.due = json_obj.get('due', '')[:10]
TypeError: 'NoneType' object has no attribute '__getitem__'

Expiration = None/never

Hey Guys,
New to github so hopefully not using this totally wrong but when I input the URL provided by util.py I get an error "Invalid Expiry".

If I change the 'None' at the end of the URL to 'never' it works fine.

With this in mind it may be worth changing the following line:

expiration = os.environ.get('TRELLO_EXPIRATION', None)

to

expiration = os.environ.get('TRELLO_EXPIRATION', 'never')

Again, if this is not the correct place to be flagging this, please let me know!

Card.checklist is failing

DEBUG 2015-06-09 23:29:07,418 Configuring Raven for host: http://DEADBEEFDEADBEEFDEADBEEFDEADBEEF:DEADBEEFDEADBEEFDEADBEEFDEADBEEF@localhost:9000:/2
Traceback (most recent call last):
  File "./manage.py", line 10, in <module>
    execute_from_command_line(sys.argv)
  File "/opt/envs/cinematique/local/lib/python2.7/site-packages/django/core/management/__init__.py", line 399, in execute_from_command_line
    utility.execute()
  File "/opt/envs/cinematique/local/lib/python2.7/site-packages/django/core/management/__init__.py", line 392, in execute
    self.fetch_command(subcommand).run_from_argv(self.argv)
  File "/opt/envs/cinematique/local/lib/python2.7/site-packages/django/core/management/base.py", line 242, in run_from_argv
    self.execute(*args, **options.__dict__)
  File "/opt/envs/cinematique/local/lib/python2.7/site-packages/django/core/management/base.py", line 285, in execute
    output = self.handle(*args, **options)
  File "/srv/www/cinematique/cin/core/management/commands/test_trello.py", line 24, in handle
    API.create_new_uploaded_card(list_id=TrelloAPI.TRELLO_IPP_CONSTANTS['UPLOADED'], video=None)
  File "/srv/www/cinematique/cin/core/trello_api.py", line 64, in create_new_uploaded_card
    print card.checklists
  File "/opt/envs/cinematique/local/lib/python2.7/site-packages/trello/__init__.py", line 744, in checklists
    if self._checklists is None:
AttributeError: 'Card' object has no attribute '_checklists'```

ResourceUnavailable after calling some APIs containing write operations

Hi,

I am using py-trello for a project. One of the dependency 'oauth2' was missing from the PyPI version of the package, which is very old (0.6.0). I was able to figure the oauth2.Consumer class was present in later release of the package by using the latest simplegeo/python-oauth2. However, the program seems to behave very weird. I kept getting HTTP 400 randomly. I was able to have some lucks with py-trello until making a call to anything contains write operation like below.

The token requested contains read and write access. Expiration was set to never.

I tested the same operations using requests. It worked fine without issues.

client = TrelloClient(api_key=TRELLO_API_KEY, api_secret=TRELLO_API_SECRET,
                              token=token, token_secret=token_secret)

boards = client.list_boards()
b = boards[0]
print b
lists = b.all_lists()
try:
    for l in lists:
        l.add_card("Hello")
except:
    print "Something wrong"
print b.open_lists()

Here is the stack trace

Traceback (most recent call last):
  File "test_py_trello.py", line 20, in <module>
    print b.open_lists()
  File "/Users/kennethfeng/anaconda/lib/python2.7/site-packages/trello/__init__.py", line 283, in open_lists
    return self.get_lists('open')
  File "/Users/kennethfeng/anaconda/lib/python2.7/site-packages/trello/__init__.py", line 293, in get_lists
    query_params = {'cards': 'none', 'filter': list_filter})
  File "/Users/kennethfeng/anaconda/lib/python2.7/site-packages/trello/__init__.py", line 177, in fetch_json
    raise ResourceUnavailable(url, response)

trello.ResourceUnavailable: Resource unavailable: https://api.trello.com/1/boards/*******************/lists?key=****************************&token=********************************&cards=none&filter=open (HTTP status: 400)

I forked the library and ran nosetests -v test/. It seems to confirm my observation.

test01_list_boards (test_trello.TrelloClientTestCase) ... ok
test10_board_attrs (test_trello.TrelloClientTestCase) ... ok
test20_board_all_lists (test_trello.TrelloClientTestCase) ... ok
test21_board_open_lists (test_trello.TrelloClientTestCase) ... ok
test22_board_closed_lists (test_trello.TrelloClientTestCase) ... ok
test30_list_attrs (test_trello.TrelloClientTestCase) ... ok
test40_list_cards (test_trello.TrelloClientTestCase) ... ok
test50_add_card (test_trello.TrelloClientTestCase) ... FAIL
test51_add_card (test_trello.TrelloClientTestCase) ... FAIL

======================================================================
FAIL: test50_add_card (test_trello.TrelloClientTestCase)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/Users/kennethfeng/dev/repos/py-trello/test/test_trello.py", line 90, in test50_add_card
    self.fail("Caught Exception adding card")
AssertionError: Caught Exception adding card
-------------------- >> begin captured stdout << ---------------------
can't set attribute

--------------------- >> end captured stdout << ----------------------

======================================================================
FAIL: test51_add_card (test_trello.TrelloClientTestCase)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/Users/kennethfeng/dev/repos/py-trello/test/test_trello.py", line 116, in test51_add_card
    self.fail("Caught Exception adding card")
AssertionError: Caught Exception adding card
-------------------- >> begin captured stdout << ---------------------
can't set attribute

--------------------- >> end captured stdout << ----------------------

----------------------------------------------------------------------
Ran 9 tests in 2.976s

FAILED (failures=2)

If you could quickly pin point the issue, that's great.

If not, that's still fine. It seems like it's better to migrate to requests from httplib2 and to rauth from oauth2. If you agree, I will send you pull requests after I am done with the migration.

Kenneth

Contribution of Board.close()

Last one for now (I think):

def close(self):
    self.client.fetch_json(
        '/boards/'+self.id+'/closed',
        http_method = 'PUT',
        post_args = {'value': 'true',},)
    self.closed = True

TypeError when query is empty

When I carry out a query without filters, such as:

board.get_cards()

I get this error below. Putting in a query gets rid of this error.

Traceback (most recent call last):
  File "./test.py", line 22, in <module>
    cards = source_board.get_cards()
  File "/usr/local/lib/python2.7/dist-packages/trello/__init__.py", line 345, in get_cards
    query_params=filters
  File "/usr/local/lib/python2.7/dist-packages/trello/__init__.py", line 156, in fetch_json
    url = self.build_url(uri_path, query_params)
  File "/usr/local/lib/python2.7/dist-packages/trello/__init__.py", line 106, in build_url
    if len(query) > 0:
TypeError: object of type 'NoneType' has no len()

New pypi release

It would be great if the version on Pypi would be updated, it's a tad out of date :)

This should do the trick:

python setup.py sdist upload

Contribution of TrelloClient.add_board()

I needed this for my own use. It's modeled strongly off of Board.add_list():

def add_board(self, board_name):
    obj = self.fetch_json('/boards', http_method = 'POST', post_args = {'name':board_name})
    board = Board(self, obj['id'], name=obj['name'].encode('utf-8'))
    board.closed = obj['closed']
    return board 

Feel free to add it, revise it, whatever.

Support for Organization?

It looks like the library cannot support Organization, any plans to add support for it?

It would also to manage members of an Org.

ImportError: No module named oauth2

Your pip doesn't include the dependency on oauth2.

I do:
pip install py-trello
python
import trello
Traceback (most recent call last):
File "", line 1, in
File "/Users/tirsen/triposo/devel/www/venv/lib/python2.7/site-packages/trello/init.py", line 5, in
import oauth2 as oauth
ImportError: No module named oauth2

Reading existing checklists

I have a checklist on a card in Trello.
If I use the fetch_checklists() function card.fetch_checklists() - I get the following error:
Traceback (most recent call last):
File "./queue_sorter.py", line 36, in
checklists = request_list.list_cards()[0].fetch_checklists()
File "/usr/local/lib/python2.7/dist-packages/trello/card.py", line 176, in fetch_checklists
checklists.append(Checklist(self.client, self.checked, cl,
AttributeError: 'Card' object has no attribute 'checked'

I can use py-trello to create the checklist, I just cant seem to read back the checklist values in a different python script.
Any ideas what I am doing wrong?

ImportError: No module named 'board'

Hi there,

I have installed with:

sudo pip install py-trello

I can see the files was installed to:

/usr/local/lib/python3.4/dist-packages/trello

There is a file called:

/usr/local/lib/python3.4/dist-packages/trello/board.py

But each time I run my script I get the following error:

Traceback (most recent call last):
File "myscript.py", line 5, in
from trello import TrelloClient
File "/usr/local/lib/python3.4/dist-packages/trello/init.py", line 2, in
from board import *
ImportError: No module named 'board'

Documentation

Is there some kind of documentation for the package ? I find it very hard to get started with it.

Sample on how to create a simple CARD

Hello,
as i'm new to trellon, in the actual doc, I didnt find an example of code on how to create a card with a description.
Could you make a page that summarize this ?
Regards

In python3, I got some bytes

Hello,

I'm trying py-trello with python3 and py-trello gave me one bytes on the name property of a board.
I don't think it's a normal case to give bytes here, a name is clearly a string, no a random sequence of characters.

I'll not discuss too long about this in this ticket, hoping you're OK with me on this point, but I'm clearly open to go deep into the details about what I think on the subject if asked.

Also I'm OK to help, but before working on this, I prefer to discuss it :)

Bests

TypeError: argument of type 'Board' is not iterable

While trying to call all_cards() on a board, I got:

  File "foobar.py", line 57, in board
    print(board.all_cards())
  File "/home/julien/py-trello/trello/__init__.py", line 283, in all_cards
    return self.get_cards(filters)
  File "/home/julien/py-trello/trello/__init__.py", line 314, in get_cards
    return list([Card.from_json(json, self) for json in json_obj])
  File "/home/julien/py-trello/trello/__init__.py", line 314, in <listcomp>
    return list([Card.from_json(json, self) for json in json_obj])
  File "/home/julien/py-trello/trello/__init__.py", line 522, in from_json
    if 'id' not in json_obj:
TypeError: argument of type 'Board' is not iterable

Bests

Checklists don't respect their POS ordering

It would be nice if fetch_checklists respected the order of checklists.

        json_obj = self.client.fetch_json(
            '/cards/' + self.id + '/checklists', )

        # This line is new:
        json_obj = sorted(json_obj, key=lambda checklist: checklist['pos'])

        for cl in json_obj:
            checklists.append(Checklist(self.client, self.checked, cl,
                                        trello_card=self.id))

Get card by ID

Hi,

Is there any way of getting a card by id (only id)? Something like

c = trello.Card(id='card_id')

Thanks!

HELP: JSON TypeError not seriablizable

Please help me figure out how to make this work. I am grabbing a list and attempting to move cards one by one out of that list and to another one. I keep getting the error listed in the title of this issue comment.

I'm running this via a python management command and I have not imported json and am not wrapping anything in json. sample code:

for card in me.get_list('<list_id>').list_cards():
    if card.name.split(':')[0].lower().strip() in merged_names_list:
        card.change_list(me.get_list('<list_id2>'))
    elif card.name.split(':')[0].lower().strip() in unmerged_names_list:
        card.change_list(me.get_list('<list_id3>'))

Refactor to remove 'trello.client.Trello'

To run the tests, you need to do this:

PYTHONPATH=../ python tests.py

due to the package structure being less-than-ideal (thanks, python). Refactor all classes into __init__.py to remove this wonky structure.

NameError: name 'unicode' is not defined

Error:

File "/usr/local/lib/python3.4/dist-packages/trello/compat.py", line 13, in force_str
if PY2 and isinstance(s, unicode): # noqa
NameError: name 'unicode' is not defined

when calling list_boards() on a TrelloClient instance.

Works fine in version 0.5.0 but breaks in 0.6.0.

Python version: 3.4.3
sys.version_info returns:

sys.version_info(major=3, minor=4, micro=3, releaselevel='final', serial=0)

Documentation missing

I'm missing any documentation. The tests gave me a hint but docstrings or a brief API documentation would really help.

AttributeError: 'Http' object has no attribute 'fetch_json' when calling list_cards()

When I run an example list test40_add_card() in test_trello.py, I have no trouble calling add_card() on a list object, however, if I get a card in a different way, then it looks like the client attribute isn't initialized correctly. My usage is a bit convoluted, namely because I don't see a way to fetch a card by its ID or its name, but:
b = trello.get_board('myboard')
for card in b.get_cards(myfilter):
if card == desired_card:
l = trello.get_list(card.idList)
l.add_card(cardname, 'delete me')

gives me the AttributeError. The documentation is a little sparse but am I expected to initialize objects in a certain order or ... ?

Ultimately I'm trying to implement a List.copy_card() method to create a new card from a template in a given list.

Webhooks support

Are there any plans to add support for adding/deleting webhooks? If there isn't anybody already planning on doing so, I was thinking about adding it in and sending a pull request when I get a chance.

Extracting string data from cards

I can pull down lists and cards and card data, specifically strings, from the api but the get_cards() class member returns a Card class type. How can I use something like card.split() with the return type.

I just want to parse a '-' delimited string.

Failing tests

o/

I just tried to ran the tests after setting up my OAUTH like readme told me, and got:

$ PYTHONPATH=. python test/test_trello.py
F.....EEE.EFF
======================================================================
ERROR: test40_add_card (__main__.TrelloClientTestCase)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "test/test_trello.py", line 118, in test40_add_card
    if not card:
UnboundLocalError: local variable 'card' referenced before assignment

======================================================================
ERROR: test41_add_card (__main__.TrelloClientTestCase)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "test/test_trello.py", line 145, in test41_add_card
    if not card:
UnboundLocalError: local variable 'card' referenced before assignment

======================================================================
ERROR: test42_add_card_with_comments (__main__.TrelloClientTestCase)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "test/test_trello.py", line 176, in test42_add_card_with_comments
    if not card:
UnboundLocalError: local variable 'card' referenced before assignment

======================================================================
ERROR: test51_fetch_cards (__main__.TrelloClientTestCase)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "test/test_trello.py", line 89, in test51_fetch_cards
    self.assertIsInstance(c.date_last_activity, datetime, msg='date not provided')
  File "/usr/lib/python2.7/unittest/case.py", line 968, in assertIsInstance
    if not isinstance(obj, cls):
TypeError: isinstance() arg 2 must be a class, type, or tuple of classes and types

======================================================================
FAIL: test01_list_boards (__main__.TrelloClientTestCase)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "test/test_trello.py", line 21, in test01_list_boards
    int(os.environ['TRELLO_TEST_BOARD_COUNT']))
AssertionError: 2 != 1

======================================================================
FAIL: test52_get_cards (__main__.TrelloClientTestCase)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "test/test_trello.py", line 182, in test52_get_cards
    self.assertEquals(len(boards), 1, msg="Test board not found")
AssertionError: Test board not found

======================================================================
FAIL: test60_delete_cards (__main__.TrelloClientTestCase)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "test/test_trello.py", line 201, in test60_delete_cards
    self.assertEquals(len(boards), 1, msg="Test board not found")
AssertionError: Test board not found

----------------------------------------------------------------------
Ran 13 tests in 5.341s

FAILED (failures=3, errors=4)

Release next version

Hey, I want to kindly ask if there are plans for the next release?

I would like to see especially 3340451 be in the released version.

Can I somehow help to get the next release out?

In test_board.py test_delete_cards fails

It seems as if this test is meant for closing cards.

It is taking number of closed cards as "deleted",
number of open cards
deleting all open cards
then looking for current closed cards to be equal to "deleted" + number open cards.

Either the API used to delete open cards by closing them and this test used to work or something is wrong with the test.

Happy to submit a fix for either closing or deleting or both.

fetch_checklists from card fails

See the error when I tryied to get the checklists.
Thanks

cards = board.get_cards(card_filter='open')
c0 = cards[0]
c0.fetch_checklists()
---------------------------------------------------------------------------
AttributeError                            Traceback (most recent call last)
<ipython-input-9-08ec974f514e> in <module>()
----> 1 c0.fetch_checklists()

c:\miniconda3\lib\site-packages\trello\card.py in fetch_checklists(self)
    198         json_obj = sorted(json_obj, key=lambda checklist: checklist['pos'])
    199         for cl in json_obj:
--> 200             checklists.append(Checklist(self.client, self.checked, cl,
    201                                         trello_card=self.id))
    202         return checklists

AttributeError: 'Card' object has no attribute 'checked'

Add support for copying a board.

The POST /1/boards API has idBoardSource and keepFromSource to support copying a board. This would be pretty useful for what I want to do (generate new boards daily and weekly).

ssl certificate fail

I found this problem started to raise since a week ago, seems somehow the trello https certification is not recognized by the httplib2 client.

    doing = client.get_list(list_id)
  File "/home/vagrant/venv/lib/python2.7/site-packages/trello/__init__.py", line 145, in get_list
    obj = self.fetch_json('/lists/' + list_id)
  File "/home/vagrant/venv/lib/python2.7/site-packages/trello/__init__.py", line 171, in fetch_json
    body = json.dumps(post_args))
  File "/home/vagrant/venv/lib/python2.7/site-packages/httplib2/__init__.py", line 1588, in request
    (response, content) = self._request(conn, authority, uri, request_uri, method, body, headers, redirections, cachekey)
  File "/home/vagrant/venv/lib/python2.7/site-packages/httplib2/__init__.py", line 1336, in _request
    (response, content) = self._conn_request(conn, request_uri, method, body, headers)
  File "/home/vagrant/venv/lib/python2.7/site-packages/httplib2/__init__.py", line 1272, in _conn_request
    conn.connect()
  File "/home/vagrant/venv/lib/python2.7/site-packages/httplib2/__init__.py", line 1037, in connect
    raise SSLHandshakeError(e)
httplib2.SSLHandshakeError: [Errno 1] _ssl.c:504: error:14090086:SSL routines:SSL3_GET_SERVER_CERTIFICATE:certificate verify failed

I can use this to workaround, but maybe the better way is ignoring the certificate error in the py-trello lib, like this, since we believe the trello website is safe enough.

AttributeError: 'Client' object has no attribute 'fetch_json'

trello = TrelloClient(...)
task_list = trello.get_list('SOME ID')
task_list.list_cards()

def get_list(self, list_id):
    obj = self.fetch_json('/lists/' + list_id)
    return List.from_json(board=self, json_obj=obj)

self - is TrelloClient, not Board

Possible bug card.py L158

While writing a MR my flake8 check showed up that on line 158 of card.py there is an undefined used of 'checklist', I think this may be a copy-paste error for 'comment'.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.