Skip to main content

Automate TaskWarrior from Python: type-safe Pydantic DTOs, virtual tags, and sync

Project description

pytaskwarrior

Python 3.9+ License: MIT Code style: ruff Tests PyPI version

A modern Python library for TaskWarrior v3.x task management.

No task binary required. pytaskwarrior uses taskchampion3-py-dev — Rust bindings to the taskchampion storage engine — for direct, high-performance SQLite access.

Features

  • No external binary — reads/writes TaskWarrior's SQLite database directly
  • Full CRUD operations — Create, read, update, delete tasks
  • Type-safe — Pydantic models with full type hints
  • Context management — Define, apply, and switch contexts (reads/writes .taskrc)
  • UDA support — User Defined Attributes
  • Virtual tags+OVERDUE, +DUE, +TODAY, +WEEK, +BLOCKED, +READY, and 20+ more
  • Date expressionsdue.before:tomorrow, due.after:eom, compound expressions (now + P3D)
  • Recurring tasks — Full recurrence support
  • Annotations — Add notes to tasks
  • Sync — Remote and local directory sync via taskchampion protocol
  • Optional CLI fallback — Pass task_cmd="task" to use the classic CLI adapter

Requirements

  • Python 3.9+
  • taskchampion3-py-dev >= 3.0.1.3 (installed automatically)

The task binary is not required for the default adapter.

Installation

pip install pytaskwarrior

Quick Start

from taskwarrior import TaskWarrior, TaskInputDTO, Priority

# No binary needed — uses taskchampion SQLite backend directly
tw = TaskWarrior()

# Create a task
task = tw.add_task(TaskInputDTO(
    description="Finish project report",
    priority=Priority.HIGH,
    project="work",
    tags=["urgent"],
    due="friday",
))

# Query tasks
for t in tw.get_tasks("project:work +READY"):
    print(f"[{t.priority or '-'}] {t.description}")

# Virtual tag filtering
overdue = tw.get_tasks("+OVERDUE")
due_soon = tw.get_tasks("due.before:eow")

# Complete a task
tw.done_task(task.uuid)

Documentation

Full documentation: pytaskwarrior.readthedocs.io

See Also

  • TaskMajor — MCP server providing TaskWarrior integration for AI assistants. Built entirely on pytaskwarrior.

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

pytaskwarrior-3.0.2.tar.gz (50.0 kB view details)

Uploaded Source

Built Distribution

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

pytaskwarrior-3.0.2-py3-none-any.whl (59.1 kB view details)

Uploaded Python 3

File details

Details for the file pytaskwarrior-3.0.2.tar.gz.

File metadata

  • Download URL: pytaskwarrior-3.0.2.tar.gz
  • Upload date:
  • Size: 50.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for pytaskwarrior-3.0.2.tar.gz
Algorithm Hash digest
SHA256 9b8a4d7271be29b7ff749563c5240e13314b947b150507a61cf9fb1ebae53e03
MD5 d4e4bdb990d184b88fe96b9d85396cd5
BLAKE2b-256 e831cda8b4ee14c1cb00e5efd5ff42a3d96b9e28c4de3e04fbd70d49ac4cf9c2

See more details on using hashes here.

Provenance

The following attestation bundles were made for pytaskwarrior-3.0.2.tar.gz:

Publisher: release.yml on sznicolas/pytaskwarrior

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file pytaskwarrior-3.0.2-py3-none-any.whl.

File metadata

  • Download URL: pytaskwarrior-3.0.2-py3-none-any.whl
  • Upload date:
  • Size: 59.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for pytaskwarrior-3.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 b50ad16f4ef7be69eeffc9e9d7ae4c802d1e28e599dea430c2593831b4b7545b
MD5 a34ccf148f9664e2be5b09310b4cbb1e
BLAKE2b-256 ad8dfbcfa33aa4d8dad0356b18bdf2652a9cdf26ee90b59540cf54da7f13f2e5

See more details on using hashes here.

Provenance

The following attestation bundles were made for pytaskwarrior-3.0.2-py3-none-any.whl:

Publisher: release.yml on sznicolas/pytaskwarrior

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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