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.
Source Distribution
File details
Details for the file todoist-0.0.1.tar.bz2
.
File metadata
- Download URL: todoist-0.0.1.tar.bz2
- Upload date:
- Size: 6.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | d7b5ac3efbb35c9613d0d0b56213494be787e9478c5870d876b35374dfcb7788 |
|
MD5 | 230c870e4be31996dc81469fd09c3ec5 |
|
BLAKE2b-256 | fbe5692c3e11abdf34754f9ae6a394c3dbf5b5d63cadd369687eda3c15bbcd5d |