Package: anydo_api
This simple client library provides access to basic features ofAnyDotask manager in a
easy and object-oriented style.It could be used for own projects integration’s or as a tool for migration from one task manager to another.Supported FeaturesUser CRUD operationsPersonal tasks CRUD and sharingPersonal lists(categories) CRUDRequirementsAutomatically testing forPython 2.7andPython 3.4.Usesrequests>=2.8.0for remote API calls.Install$ pip install anydo_apior directly from the repository:$ git clone https://github.com/aliaksandrb/anydo_api
$ cd anydo_api
$ python setup.py installUsage & examples:Currently not all functionality from the originalChrome/Android/..clients are supported.
Some of them just have no sense for console client, some just not ready yet :)Here is what we have for now:User management:>>> from anydo_api.client import ClientCreate totally new user:>>> user = Client.create_user(name='Garlic', email='name@garlic.com', password='password')Access to its attributes both ways:>>> user['name'] # > 'Garlic'
>>> user.email # > 'name@garlic.com'Change the name:>>> user['name'] = 'Tomato'
>>> user.save() # changes are pushed to server
>>> user['name'] # > 'Tomato'Login with existent account:>>> user = Client(email='name@garlic.com', password='password').get_user()
>>> user['name'] # > 'Tomato'Get the possible updates from the server (in case if user was already instantiated but changed by other client/app)>>> user.refresh()Delete your account completely. Warning! Can’t be undone:>>> user.destroy()
...Tasks management:>>> from anydo_api.client import Client
>>> from anydo_api.task import Task>>> user = Client(email='name@garlic.com', password='password').get_user()List tasks:>>> user.tasks() # > []Create a new task:>>> task = Task.create(
               user=user,
               title='Clean garden',
               priority='High',
               category='Personal',
               repeatingMethod='TASK_REPEAT_OFF')>>> task['assignedTo'] # > 'name@garlic.com'
>>> task.status # > 'UNCHECKED'Add note for task:>>> task.add_note('first task')
>>> task.notes() # > ['first task']Add a subtasks:>>> subtask = Task.create(user=user, title='Find a water', priority='Normal')
>>> task.add_subtask(subtask)
>>> subtask.parent()['title'] # > 'Clean garden'
>>> task.subtasks()[0]['title'] # > 'Find a water'Check the task:>>> subtask['status'] # > 'UNCHECKED'
>>> subtask.check()
>>> subtask['status'] # > 'CHECKED'Delete the task:>>> subtask.destroy()
>>> len(user.tasks()) # > 2
>>> len(user.tasks(refresh=True)) # > 1
...Lists(categories) management:>>> from anydo_api.client import Client
>>> from anydo_api.category import Category
>>> from anydo_api.task import Task>>> user = Client(email='name@garlic.com', password='password').get_user()List categories:>>> list(map(lambda category: category['name'], user.categories())) # > ['GROCERY LIST', 'PERSONAL ERRANDS']Create a new category:>>> category = Category.create(user=user, name='Home')
>>> list(map(lambda category: category['name'], user.categories(refresh=True)))
# > ['GROCERY LIST', 'PERSONAL ERRANDS', 'Home']List category tasks:>>> category.tasks() # > []
>>> task = Task.create(user=user, title='In new category', priority='Normal')
>>> category.add_task(task)
>>> category.tasks()[0]['title'] # > 'In new category'Make category default one, for new tasks:>>> category.default # > False
>>> category.mark_default()
>>> category.default # > TrueDelete the category:>>> category.destroy()
>>> list(map(lambda category: category['name'], user.categories(refresh=True)))
# > ['GROCERY LIST', 'PERSONAL ERRANDS']
...& More complex example, task sharing:Assume we have two users:PacaandVaca.
UserPacahas a one task it wants to share withVaca.>>> task = paca.tasks()[0]
>>> task['title'] # > 'Paca Task'
>>> task.members() # > [{'paca@garlic.com': 'Paca'}]Share task with user:>>> task.share_with(vaca)Until task isn’t approved it isn’t shared:>>> vaca.tasks() # > []
>>> vaca.pending_tasks()
# > [{'id': 'm8cEmJJFXgYWrr3Xplj9zw==', 'invitedBy': {'name': 'Paca', 'email': 'paca@garlic.com', 'picture': None}, 'message': None, 'title': 'Paca Task'}]Approve the pending task:>>> vaca.approve_pending_task(pending_task=vaca.pending_tasks()[0])And now it is shared:>>> vaca.tasks()[0]['title'] # > 'Paca Task'>>> task.members()
[{'paca@garlic.com': 'Paca'}, {'vaca@garlic.com': 'vaca@garlic.com'}]
...For other methods and full support API check the docs or source code..ContributionsFeedback, issue reports and feature/pull requests are greatly appreciated!
You could post theminto issues.Generic guide for contributions is placedhere.Thanks!MIT licenseAutomaticaly generated documentation:http://anydo-api.readthedocs.org/en/latest/.History0.0.2 (2017-04-25)Fix issue with an uuid generation on Py3.0.0.1 (2015-10-12)First release on PyPI.