GithubHelp home page GithubHelp logo

pombredanne / taskw Goto Github PK

View Code? Open in Web Editor NEW

This project forked from ralphbean/taskw

0.0 1.0 0.0 341 KB

python taskwarrior api

Home Page: http://threebean.org

License: GNU General Public License v3.0

taskw's Introduction

taskw - Python API for the taskwarrior DB

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'

taskw's People

Contributors

burnison avatar campbellr avatar fdev31 avatar kostajh avatar neingeist avatar ralphbean avatar rossdylan avatar tychoish avatar umonkey avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.