todoist is a Python wrapper around the Todoist API
Project description
Python Todoist is a Python wrapper around the Todoist API. It provides a Python interface for the Todoist API.
Installation
First of all, you need to setuptools to installation. Then, clone the repository from:
git@github.com:amix/Todoist-API-s.git
Enter the repository directory and run:
$ python setup.py build $ python setup.py install
Testing
We’re using nose for testing. In repository directory, run this command:
$ python setup.py nosetests
Usage
Let’s try to login and get profile information:
>>> from todoist.base import StandardAPI >>> api = StandardAPI() >>> login = api.login(email='gkmngrgn@gmail.com', password='blablabla')
If you login successfully, you can see profile information in login variable:
>>> print(login) {u'api_token': u'blablablablablatrollololo', u'date_format': 1, u'default_reminder': None, u'email': u'gkmngrgn@gmail.com', u'full_name': u'Gubba Gubba', u'id': 000000, u'jabber': None, u'mobile_host': None, u'mobile_number': None, u'msn': None, u'notifo': None, u'premium_until': None, u'sort_order': 0, u'start_page': u'_blank', u'time_format': 1, u'timezone': u'Europe/Istanbul', u'twitter': None, u'tz_offset': [u'+02:00', 2, 0, 0]}
Hmm, my name is not Gubba Gubba, i should change it, but how:
>>> api.update_user(full_name='Gökmen Görgen') {u'api_token': u'blablablablablatrollololo', u'date_format': 1, u'default_reminder': None, u'email': u'gkmngrgn@gmail.com', u'full_name': u'Gökmen Görgen', u'id': 100000, u'jabber': None, u'mobile_host': None, u'mobile_number': None, u'msn': None, u'notifo': None, u'premium_until': None, u'sort_order': 0, u'start_page': u'_blank', u'time_format': 1, u'timezone': u'Europe/Istanbul', u'twitter': None, u'tz_offset': [u'+02:00', 2, 0, 0]}
Perfect! To get project list, use get_projects():
>>> api.get_projects() [{u'cache_count': 0, u'collapsed': 0, u'color': u'#ff8581', u'id': 1111111, u'indent': 1, u'item_order': 8, u'last_updated': u'1328809772.38', u'name': u'example_project', u'user_id': 100000}, {u'cache_count': 25, u'collapsed': 0, u'color': u'#ff8581', u'id': 1111112, u'indent': 1, u'item_order': 9, u'last_updated': u'1328809772.40', u'name': u'personal', u'user_id': 100000}]
I have two projects named “example_project” and “personal”. For more information about Todoist API, you can see the official api documentation: http://todoist.com/API/help
License
Coded by Gökmen Görgen. Copyright (C) 2012, Todoist
This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.