This release is a pre-release and may not be stable for production use.
This is a python API for the taskwarrior command line tool.
It contains two implementations: taskw.TaskWarriorShellout and taskw.TaskWarriorDirect. The first implementation is the supported one recommended by the upstream taskwarrior core project. It uses the task export and task import commands to manipulate the task database. The second implementation opens the task db file itself and directly manipulates it. It exists for backwards compatibility, but should only be used when necessary.
Build Status
Branch |
Status |
|---|---|
master |
|
develop |
Getting taskw
Installing
Using taskw requires that you first install taskwarrior.
Installing it from http://pypi.python.org/pypi/taskw is easy with pip:
$ pip install taskw
The Source
You can find the source on github at http://github.com/ralphbean/taskw
Examples
Looking at tasks
>>> from taskw import TaskWarrior >>> w = TaskWarrior() >>> tasks = w.load_tasks() >>> tasks.keys() ['completed', 'pending'] >>> type(tasks['pending']) <type 'list'> >>> type(tasks['pending'][0]) <type 'dict'>
Adding tasks
>>> from taskw import TaskWarrior
>>> w = TaskWarrior()
>>> w.task_add("Eat food")
>>> w.task_add("Take a nap", priority="H", project="life", due="1359090000")
Completing tasks
>>> from taskw import TaskWarrior >>> w = TaskWarrior() >>> w.task_done(46)
Being Flexible
You can point taskw at different taskwarrior databases.
>>> from taskw import TaskWarrior
>>> w = TaskWarrior(config_filename="~/some_project/.taskrc")
>>> w.task_add("Use 'taskw'.")
Looking at the config
>>> from taskw import TaskWarrior >>> w = TaskWarrior() >>> config = w.load_config() >>> config['data']['location'] '/home/threebean/.task' >>> config['_forcecolor'] 'yes'
Using Python-appropriate Types (Dates, UUIDs, etc)
>>> from taskw import TaskWarrior
>>> w = TaskWarrior(marshal=True)
>>> w.get_task(id=10)
(10,
{
'description': 'Hello there!',
'entry': datetime.datetime(2014, 3, 14, 14, 18, 40, tzinfo=tzutc())
'id': 10,
'project': 'Saying Hello',
'status': 'pending',
'uuid': UUID('4882751a-3966-4439-9675-948b1152895c')
}
)
Release files for taskw ralphbean
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| taskw-ralphbean.tar.gz | 37.2 kB | Details |
Release files / taskw-ralphbean.tar.gz
| Download URL | taskw-ralphbean.tar.gz |
|---|---|
| Size | 37.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
413bc90d5448792082df611ebd74ecd557656d98dca6ca00b852da7680cece6a
|
|
BLAKE2b-256 checksum How to use checksums |
e5b6354cd7176f2f831caa1283128fdbcf30343f97c1ab1f7c880c61fc8b9064
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |