Skip to main content

taskw-ng - Python API for the Taskwarrior DB

This project is a continuation of the taskw python wrapper.

This is a python API for the Taskwarrior command line task manager. It supports interacting with Taskwarirrior version >= 2.5.

Getting taskw-ng

Installing

Using taskw-ng requires that you first install Taskwarrior.

Installing it from http://pypi.org/project/taskw-ng is easy with pip:

pip install taskw-ng

Examples

Looking at tasks

from taskw_ng 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_ng import TaskWarrior
w = TaskWarrior()
w.task_add("Eat food")
w.task_add("Take a nap", priority="H", project="life", due="1359090000")

Retrieving tasks

from taskw_ng import TaskWarrior
w = TaskWarrior()
w.get_task(id=5)

Updating tasks

from taskw_ng import TaskWarrior
w = TaskWarrior()
id, task = w.get_task(id=14)
task['project'] = 'Updated project name'
w.task_update(task)

Deleting tasks

from taskw_ng import TaskWarrior
w = TaskWarrior()
w.task_delete(id=3)

Completing tasks

from taskw_ng import TaskWarrior
w = TaskWarrior()
w.task_done(id=46)

Being Flexible

You can point taskw-ng at different Taskwarrior databases.

from taskw_ng import TaskWarrior
w = TaskWarrior(config_filename="~/some_project/.taskrc")
w.task_add("Use taskw_ng.")

Looking at the config

from taskw_ng 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_ng import TaskWarrior
w = TaskWarrior(marshal=True)
w.get_task(id=10)
# should give the following:
# (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')
#  }
# )

Metadata

Release files for taskw-ng 0.2.7

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for taskw-ng 0.2.7
File Size Uploaded
taskw_ng-0.2.7.tar.gz 32.4 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for taskw-ng 0.2.7
File Interpreter ABI Platform
taskw_ng-0.2.7-py3-none-any.whl Python 3 none any Details

Total release size: 68.4 kB

Release files / taskw_ng-0.2.7.tar.gz

Download URL taskw_ng-0.2.7.tar.gz
Size 32.4 kB
Tags Source
SHA-256 checksum
How to use checksums
558942b94b8bcdfa4a4e9c237ca129b37f0f9baeab3608a9b0a70d8f4d499013
BLAKE2b-256 checksum
How to use checksums
ee7a9b909fa736c64aa21ba9af3616f7f7bb0781692892a429127c763f210422
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.8.3 CPython/3.11.0 Linux/6.5.0-1025-azure

Release files / taskw_ng-0.2.7-py3-none-any.whl

Download URL taskw_ng-0.2.7-py3-none-any.whl
Size 36.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
db956b404b9e992ffe0ad46a7dafea4d591b156fc5dbf009a2a453bfa5a721ea
BLAKE2b-256 checksum
How to use checksums
1b709e05ca7af0a95708649bdf5c12821dc41cc49709ff88b4665891b248d929
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.8.3 CPython/3.11.0 Linux/6.5.0-1025-azure

Release history Release notifications | RSS feed

This release

0.2.7 This release

2 release files

0.2.6

2 release files

0.2.5

2 release files

0.2.4

2 release files

0.2.3

2 release files

0.2.1

2 release files

0.2.0

2 release files

0.1.1

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page