# `taskw-ng` - Python API for the Taskwarrior DB
> This project is a continuation of the [taskw python
wrapper](https://github.com/ralphbean/taskw).
This is a python API for the [Taskwarrior](http://taskwarrior.org) 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](http://taskwarrior.org).
Installing it from http://pypi.org/project/taskw-ng is easy with `pip`:
```sh
pip install taskw-ng
```
## Examples
### Looking at tasks
```python
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
```python
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
```python
from taskw_ng import TaskWarrior
w = TaskWarrior()
w.get_task(id=5)
```
### Updating tasks
```python
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
```python
from taskw_ng import TaskWarrior
w = TaskWarrior()
w.task_delete(id=3)
```
### Completing tasks
```python
from taskw_ng import TaskWarrior
w = TaskWarrior()
w.task_done(id=46)
```
### Being Flexible
You can point `taskw-ng` at different Taskwarrior databases.
```python
from taskw_ng import TaskWarrior
w = TaskWarrior(config_filename="~/some_project/.taskrc")
w.task_add("Use taskw_ng.")
```
### Looking at the config
```python
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)
```python
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')
# }
# )
```
Raw data
{
"_id": null,
"home_page": "https://github.com/bergercookie/taskw-ng",
"name": "taskw-ng",
"maintainer": "",
"docs_url": null,
"requires_python": ">=3.8,<4.0",
"maintainer_email": "",
"keywords": "taskwarrior,task",
"author": "Nikos Koukis",
"author_email": "nickkouk@gmail.com",
"download_url": "https://files.pythonhosted.org/packages/25/02/018049fc63ddf4460cc9c67c819b10d5cdbad147a10bd236060f725d8b9d/taskw_ng-0.2.6.tar.gz",
"platform": null,
"description": "# `taskw-ng` - Python API for the Taskwarrior DB\n\n> This project is a continuation of the [taskw python\nwrapper](https://github.com/ralphbean/taskw).\n\nThis is a python API for the [Taskwarrior](http://taskwarrior.org) command line\ntask manager. It supports interacting with Taskwarirrior version >= `2.5`.\n\n## Getting `taskw-ng`\n\n### Installing\n\nUsing `taskw-ng` requires that you first install [Taskwarrior](http://taskwarrior.org).\n\nInstalling it from http://pypi.org/project/taskw-ng is easy with `pip`:\n\n```sh\npip install taskw-ng\n```\n\n## Examples\n\n### Looking at tasks\n\n```python\nfrom taskw_ng import TaskWarrior\nw = TaskWarrior()\ntasks = w.load_tasks()\ntasks.keys()\n# ['completed', 'pending']\ntype(tasks['pending'])\n# <type 'list'>\ntype(tasks['pending'][0])\n# <type 'dict'>\n```\n\n### Adding tasks\n\n```python\nfrom taskw_ng import TaskWarrior\nw = TaskWarrior()\nw.task_add(\"Eat food\")\nw.task_add(\"Take a nap\", priority=\"H\", project=\"life\", due=\"1359090000\")\n```\n\n### Retrieving tasks\n\n```python\nfrom taskw_ng import TaskWarrior\nw = TaskWarrior()\nw.get_task(id=5)\n```\n\n### Updating tasks\n\n```python\nfrom taskw_ng import TaskWarrior\nw = TaskWarrior()\nid, task = w.get_task(id=14)\ntask['project'] = 'Updated project name'\nw.task_update(task)\n```\n\n### Deleting tasks\n\n```python\nfrom taskw_ng import TaskWarrior\nw = TaskWarrior()\nw.task_delete(id=3)\n```\n\n### Completing tasks\n\n```python\nfrom taskw_ng import TaskWarrior\nw = TaskWarrior()\nw.task_done(id=46)\n```\n\n### Being Flexible\n\nYou can point `taskw-ng` at different Taskwarrior databases.\n\n```python\nfrom taskw_ng import TaskWarrior\nw = TaskWarrior(config_filename=\"~/some_project/.taskrc\")\nw.task_add(\"Use taskw_ng.\")\n```\n\n### Looking at the config\n\n```python\nfrom taskw_ng import TaskWarrior\nw = TaskWarrior()\nconfig = w.load_config()\nconfig['data']['location']\n# '/home/threebean/.task'\nconfig['_forcecolor']\n# 'yes'\n```\n\n### Using python-appropriate types (dates, UUIDs, etc)\n\n```python\nfrom taskw_ng import TaskWarrior\nw = TaskWarrior(marshal=True)\nw.get_task(id=10)\n# should give the following:\n# (10,\n# {\n# 'description': 'Hello there!',\n# 'entry': datetime.datetime(2014, 3, 14, 14, 18, 40, tzinfo=tzutc())\n# 'id': 10,\n# 'project': 'Saying Hello',\n# 'status': 'pending',\n# 'uuid': UUID('4882751a-3966-4439-9675-948b1152895c')\n# }\n# )\n```\n",
"bugtrack_url": null,
"license": "GPLv3+",
"summary": "Next generation python bindings for your taskwarrior database",
"version": "0.2.6",
"project_urls": {
"Homepage": "https://github.com/bergercookie/taskw-ng",
"Repository": "https://github.com/bergercookie/taskw-ng"
},
"split_keywords": [
"taskwarrior",
"task"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "ca2dc34a5673e030afd97e177bc41b164dcef1d053cb597bff8bdfa991bceb83",
"md5": "f9a7aa2d7b339cc3361a1b4e40b8a465",
"sha256": "c1b10a71bd26d478c8f4ca285c67c8c2d803dc8b45d40e3b059306c5fb47dd95"
},
"downloads": -1,
"filename": "taskw_ng-0.2.6-py3-none-any.whl",
"has_sig": false,
"md5_digest": "f9a7aa2d7b339cc3361a1b4e40b8a465",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.8,<4.0",
"size": 35901,
"upload_time": "2024-01-29T13:38:48",
"upload_time_iso_8601": "2024-01-29T13:38:48.396624Z",
"url": "https://files.pythonhosted.org/packages/ca/2d/c34a5673e030afd97e177bc41b164dcef1d053cb597bff8bdfa991bceb83/taskw_ng-0.2.6-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "2502018049fc63ddf4460cc9c67c819b10d5cdbad147a10bd236060f725d8b9d",
"md5": "bad7598576f1822e4bc709a288b135de",
"sha256": "e6d3229c6f86a75622aa66ae6c18cb707f797661b6abf037f867444f6ae23efc"
},
"downloads": -1,
"filename": "taskw_ng-0.2.6.tar.gz",
"has_sig": false,
"md5_digest": "bad7598576f1822e4bc709a288b135de",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.8,<4.0",
"size": 32396,
"upload_time": "2024-01-29T13:38:55",
"upload_time_iso_8601": "2024-01-29T13:38:55.433843Z",
"url": "https://files.pythonhosted.org/packages/25/02/018049fc63ddf4460cc9c67c819b10d5cdbad147a10bd236060f725d8b9d/taskw_ng-0.2.6.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-01-29 13:38:55",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "bergercookie",
"github_project": "taskw-ng",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"tox": true,
"lcname": "taskw-ng"
}