# `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": null,
"docs_url": null,
"requires_python": "<4.0,>=3.8",
"maintainer_email": null,
"keywords": "taskwarrior, task",
"author": "Nikos Koukis",
"author_email": "nickkouk@gmail.com",
"download_url": "https://files.pythonhosted.org/packages/ee/7a/9b909fa736c64aa21ba9af3616f7f7bb0781692892a429127c763f210422/taskw_ng-0.2.7.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.7",
"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": "1b709e05ca7af0a95708649bdf5c12821dc41cc49709ff88b4665891b248d929",
"md5": "4a8b4d50cc895a665f3e9a729d00d88d",
"sha256": "db956b404b9e992ffe0ad46a7dafea4d591b156fc5dbf009a2a453bfa5a721ea"
},
"downloads": -1,
"filename": "taskw_ng-0.2.7-py3-none-any.whl",
"has_sig": false,
"md5_digest": "4a8b4d50cc895a665f3e9a729d00d88d",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": "<4.0,>=3.8",
"size": 35957,
"upload_time": "2024-08-10T10:23:56",
"upload_time_iso_8601": "2024-08-10T10:23:56.114247Z",
"url": "https://files.pythonhosted.org/packages/1b/70/9e05ca7af0a95708649bdf5c12821dc41cc49709ff88b4665891b248d929/taskw_ng-0.2.7-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "ee7a9b909fa736c64aa21ba9af3616f7f7bb0781692892a429127c763f210422",
"md5": "ccd8c448a8a9f32fe144bc174d868bba",
"sha256": "558942b94b8bcdfa4a4e9c237ca129b37f0f9baeab3608a9b0a70d8f4d499013"
},
"downloads": -1,
"filename": "taskw_ng-0.2.7.tar.gz",
"has_sig": false,
"md5_digest": "ccd8c448a8a9f32fe144bc174d868bba",
"packagetype": "sdist",
"python_version": "source",
"requires_python": "<4.0,>=3.8",
"size": 32433,
"upload_time": "2024-08-10T10:23:57",
"upload_time_iso_8601": "2024-08-10T10:23:57.746266Z",
"url": "https://files.pythonhosted.org/packages/ee/7a/9b909fa736c64aa21ba9af3616f7f7bb0781692892a429127c763f210422/taskw_ng-0.2.7.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-08-10 10:23:57",
"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"
}