Skip to main content

Python bindings for your taskwarrior database

Project description

This is a python API for the taskwarrior command line tool.

It contains two implementations: taskw.TaskWarrior and taskw.TaskWarriorExperimental. The first implementation is relatively stable. It manipulates the ~/.task/ dbs directly. The second implementation is in alpha and will be made default some day. It interacts with taskwarrior by shelling out to taskwarrior import and export commands as per the upstream guidelines.

Build Status

Branch

Status

master

Build Status - master branch

develop

Build Status - develop branch

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'>

Experimental mode

>>> from taskw import TaskWarriorExperimental
>>> w = TaskWarriorExperimental()
>>> 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'

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-0.7.1.tar.gz (23.8 kB view details)

Uploaded Source

File details

Details for the file taskw-0.7.1.tar.gz.

File metadata

  • Download URL: taskw-0.7.1.tar.gz
  • Upload date:
  • Size: 23.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for taskw-0.7.1.tar.gz
Algorithm Hash digest
SHA256 15401df4e6be90f4c96e63dab0ecc0cee1cdfa7c956a79678f5663505d2a4527
MD5 66e2ea5827bd64fdd59b2c77c5e77ddc
BLAKE2b-256 f6ef7f37b651a087b3f04a499c2da17e49f5ae62ac7fbe038296655f439887b2

See more details on using hashes here.

Supported by

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