Skip to main content

Next generation python bindings for your taskwarrior database

Project description

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')
#  }
# )

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

taskw_ng-0.2.5.tar.gz (32.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

taskw_ng-0.2.5-py3-none-any.whl (35.9 kB view details)

Uploaded Python 3

File details

Details for the file taskw_ng-0.2.5.tar.gz.

File metadata

  • Download URL: taskw_ng-0.2.5.tar.gz
  • Upload date:
  • Size: 32.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.7.1 CPython/3.11.0 Linux/6.2.0-1018-azure

File hashes

Hashes for taskw_ng-0.2.5.tar.gz
Algorithm Hash digest
SHA256 7837d8ea232295def35bf3e207fcf5999bd17d9a9bccc51e2c9f66ca1df91539
MD5 c8ca4c3a2f00af26b3ada60336bbb423
BLAKE2b-256 ed73c530bc19afd5e2547223f4d2be6c498e6b69f9a56935bae8d8589b208752

See more details on using hashes here.

File details

Details for the file taskw_ng-0.2.5-py3-none-any.whl.

File metadata

  • Download URL: taskw_ng-0.2.5-py3-none-any.whl
  • Upload date:
  • Size: 35.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.7.1 CPython/3.11.0 Linux/6.2.0-1018-azure

File hashes

Hashes for taskw_ng-0.2.5-py3-none-any.whl
Algorithm Hash digest
SHA256 712fab98f893ab4a4a6e8e13a1c4e522362b3898a03e4cac4df4710bee8b386a
MD5 a40acea913499e5482c888e7fe912b7f
BLAKE2b-256 b0292e0b278da7f143d018e77589ed5a2685410036f7793ee38a85c0aa53fc60

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page