Python taskw

From wikinotes

Taskwarrior already has a very simple storage format, but ralphbean created an API that makes interacting with taskwarrior even simpler.

Usage

all tasks

from taskw import TaskWarrior

tw    = TaskWarrior( marshal=True )  ## this converts all timewarrior datatypes to python native datatypes
tasks = tw.load_tasks()

tasks = {
	'completed' : [ ... ],
	'pending'   : [
							{
								'description': 'my first task',
								'id':           1,
								'entry': '20161105T201454Z',
   							'id': 1,
   							'modified': '20161105T202633Z',
   							'project': 'BigProject',
   							'status': 'pending',
   							'urgency': 1.01096,
   							'uuid': '13efd030-cb9b-4435-a086-36bf05126a0f'},
								... (any other data you added) ...
							},
						]
	}

get specific task

tw              = TaskWarrior( marshal=True )
(id, task)      = tw.get_task( id=5 )  ## get a task
task['project'] = 'new value'          ## modify data
tw.task_update( task )                 ## save changes