pytaskwarrior 1.2.0.dev0__tar.gz → 2.0.1__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (39) hide show
  1. {pytaskwarrior-1.2.0.dev0 → pytaskwarrior-2.0.1}/PKG-INFO +9 -9
  2. {pytaskwarrior-1.2.0.dev0 → pytaskwarrior-2.0.1}/PYPI_README.md +7 -6
  3. {pytaskwarrior-1.2.0.dev0 → pytaskwarrior-2.0.1}/README.md +44 -13
  4. {pytaskwarrior-1.2.0.dev0 → pytaskwarrior-2.0.1}/pyproject.toml +2 -3
  5. {pytaskwarrior-1.2.0.dev0 → pytaskwarrior-2.0.1}/src/pytaskwarrior.egg-info/PKG-INFO +9 -9
  6. {pytaskwarrior-1.2.0.dev0 → pytaskwarrior-2.0.1}/src/pytaskwarrior.egg-info/SOURCES.txt +2 -2
  7. pytaskwarrior-2.0.1/src/pytaskwarrior.egg-info/requires.txt +1 -0
  8. {pytaskwarrior-1.2.0.dev0 → pytaskwarrior-2.0.1}/src/taskwarrior/__init__.py +14 -1
  9. {pytaskwarrior-1.2.0.dev0 → pytaskwarrior-2.0.1}/src/taskwarrior/adapters/taskwarrior_adapter.py +72 -160
  10. pytaskwarrior-2.0.1/src/taskwarrior/config/config_store.py +152 -0
  11. pytaskwarrior-2.0.1/src/taskwarrior/config/uda_parser.py +65 -0
  12. {pytaskwarrior-1.2.0.dev0 → pytaskwarrior-2.0.1}/src/taskwarrior/dto/__init__.py +1 -1
  13. {pytaskwarrior-1.2.0.dev0 → pytaskwarrior-2.0.1}/src/taskwarrior/dto/annotation_dto.py +1 -3
  14. {pytaskwarrior-1.2.0.dev0 → pytaskwarrior-2.0.1}/src/taskwarrior/dto/task_dto.py +2 -6
  15. {pytaskwarrior-1.2.0.dev0 → pytaskwarrior-2.0.1}/src/taskwarrior/dto/uda_dto.py +5 -5
  16. {pytaskwarrior-1.2.0.dev0 → pytaskwarrior-2.0.1}/src/taskwarrior/exceptions.py +39 -0
  17. {pytaskwarrior-1.2.0.dev0 → pytaskwarrior-2.0.1}/src/taskwarrior/main.py +111 -39
  18. pytaskwarrior-2.0.1/src/taskwarrior/registry/uda_registry.py +70 -0
  19. {pytaskwarrior-1.2.0.dev0 → pytaskwarrior-2.0.1}/src/taskwarrior/services/context_service.py +41 -56
  20. pytaskwarrior-2.0.1/src/taskwarrior/services/uda_service.py +109 -0
  21. {pytaskwarrior-1.2.0.dev0 → pytaskwarrior-2.0.1}/src/taskwarrior/utils/conversions.py +5 -3
  22. {pytaskwarrior-1.2.0.dev0 → pytaskwarrior-2.0.1}/src/taskwarrior/utils/dto_converter.py +12 -1
  23. pytaskwarrior-1.2.0.dev0/src/pytaskwarrior.egg-info/requires.txt +0 -2
  24. pytaskwarrior-1.2.0.dev0/src/taskwarrior/protocols/sync.py +0 -8
  25. pytaskwarrior-1.2.0.dev0/src/taskwarrior/registry/uda_registry.py +0 -168
  26. pytaskwarrior-1.2.0.dev0/src/taskwarrior/services/uda_service.py +0 -84
  27. pytaskwarrior-1.2.0.dev0/src/taskwarrior/sync_backends/sync_local.py +0 -14
  28. {pytaskwarrior-1.2.0.dev0 → pytaskwarrior-2.0.1}/LICENSE +0 -0
  29. {pytaskwarrior-1.2.0.dev0 → pytaskwarrior-2.0.1}/setup.cfg +0 -0
  30. {pytaskwarrior-1.2.0.dev0 → pytaskwarrior-2.0.1}/src/__init__.py +0 -0
  31. {pytaskwarrior-1.2.0.dev0 → pytaskwarrior-2.0.1}/src/pytaskwarrior.egg-info/dependency_links.txt +0 -0
  32. {pytaskwarrior-1.2.0.dev0 → pytaskwarrior-2.0.1}/src/pytaskwarrior.egg-info/top_level.txt +0 -0
  33. {pytaskwarrior-1.2.0.dev0 → pytaskwarrior-2.0.1}/src/taskwarrior/adapters/__init__.py +0 -0
  34. {pytaskwarrior-1.2.0.dev0 → pytaskwarrior-2.0.1}/src/taskwarrior/dto/context_dto.py +0 -0
  35. {pytaskwarrior-1.2.0.dev0 → pytaskwarrior-2.0.1}/src/taskwarrior/enums.py +0 -0
  36. {pytaskwarrior-1.2.0.dev0 → pytaskwarrior-2.0.1}/src/taskwarrior/py.typed +0 -0
  37. {pytaskwarrior-1.2.0.dev0 → pytaskwarrior-2.0.1}/src/taskwarrior/registry/__init__.py +0 -0
  38. {pytaskwarrior-1.2.0.dev0 → pytaskwarrior-2.0.1}/src/taskwarrior/services/__init__.py +0 -0
  39. {pytaskwarrior-1.2.0.dev0 → pytaskwarrior-2.0.1}/src/taskwarrior/utils/__init__.py +0 -0
@@ -1,10 +1,10 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: pytaskwarrior
3
- Version: 1.2.0.dev0
3
+ Version: 2.0.1
4
4
  Summary: Taskwarrior wrapper python module
5
5
  Author-email: sznicolas <sznicolas@users.noreply.github.com>
6
6
  License-Expression: MIT
7
- Project-URL: Homepage, https://github.com/sznicolas/pytaskwarrior/
7
+ Project-URL: Homepage, https://pytaskwarrior.readthedocs.io/en/latest/
8
8
  Project-URL: Repository, https://github.com/sznicolas/pytaskwarrior/
9
9
  Project-URL: Issues, https://github.com/sznicolas/pytaskwarrior/issues
10
10
  Project-URL: Changelog, https://github.com/sznicolas/pytaskwarrior/blob/main/CHANGELOG.md
@@ -21,7 +21,6 @@ Requires-Python: >=3.12
21
21
  Description-Content-Type: text/markdown
22
22
  License-File: LICENSE
23
23
  Requires-Dist: pydantic>=2.11.7
24
- Requires-Dist: taskchampion-py>=2.0.2
25
24
  Dynamic: license-file
26
25
 
27
26
  # pytaskwarrior
@@ -35,15 +34,16 @@ Dynamic: license-file
35
34
 
36
35
  A modern Python wrapper for [TaskWarrior](https://taskwarrior.org/), the command-line task management tool.
37
36
 
38
- Production-ready with 132 tests (96% coverage), strict type checking, and professional-grade code quality. Zero linting errors, full async-safe subprocess handling, and PEP 561 type hints for IDE support.
37
+ Production-ready with 164 tests (96% coverage), strict type checking, and professional-grade code quality. Zero linting errors, full async-safe subprocess handling, PEP 561 type hints for IDE support, and a consistent exception hierarchy.
39
38
 
40
39
  ## Features
41
40
 
42
- -Full CRUD operations for tasks
43
- -Type-safe with Pydantic models
44
- -Context management
45
- -UDA (User Defined Attributes) support
46
- -Recurring tasks and annotations
41
+ - Full CRUD operations for tasks
42
+ - Type-safe with Pydantic models
43
+ - Context management
44
+ - UDA (User Defined Attributes) support
45
+ - Recurring tasks and annotations
46
+ - Consistent exception hierarchy (`TaskNotFound`, `TaskValidationError`, `TaskOperationError`, `TaskConfigurationError`, …)
47
47
 
48
48
  ## Requirements
49
49
 
@@ -9,15 +9,16 @@
9
9
 
10
10
  A modern Python wrapper for [TaskWarrior](https://taskwarrior.org/), the command-line task management tool.
11
11
 
12
- Production-ready with 132 tests (96% coverage), strict type checking, and professional-grade code quality. Zero linting errors, full async-safe subprocess handling, and PEP 561 type hints for IDE support.
12
+ Production-ready with 164 tests (96% coverage), strict type checking, and professional-grade code quality. Zero linting errors, full async-safe subprocess handling, PEP 561 type hints for IDE support, and a consistent exception hierarchy.
13
13
 
14
14
  ## Features
15
15
 
16
- -Full CRUD operations for tasks
17
- -Type-safe with Pydantic models
18
- -Context management
19
- -UDA (User Defined Attributes) support
20
- -Recurring tasks and annotations
16
+ - Full CRUD operations for tasks
17
+ - Type-safe with Pydantic models
18
+ - Context management
19
+ - UDA (User Defined Attributes) support
20
+ - Recurring tasks and annotations
21
+ - Consistent exception hierarchy (`TaskNotFound`, `TaskValidationError`, `TaskOperationError`, `TaskConfigurationError`, …)
21
22
 
22
23
  ## Requirements
23
24
 
@@ -9,17 +9,17 @@
9
9
 
10
10
  A modern Python wrapper for [TaskWarrior](https://taskwarrior.org/) v3.4, the command-line task management tool.
11
11
 
12
- **v1.1.1**: Production-ready with 132 tests (96% coverage), strict type checking, and professional-grade code quality. Zero linting errors, full async-safe subprocess handling, and PEP 561 type hints for IDE support.
12
+ **v2.0.0**: Major release with breaking API changes (Context.define now accepts ContextDTO; UdaConfig.type UdaConfig.uda_type). All tests passing and documentation updated.
13
13
 
14
14
  ## Features
15
15
 
16
- - **Full CRUD operations** - Create, read, update, delete tasks
17
- - **Type-safe** - Pydantic models with full type hints
18
- - **Context management** - Define, apply, and switch contexts
19
- - **UDA support** - User Defined Attributes
20
- - **Recurring tasks** - Full recurrence support
21
- - **Annotations** - Add notes to tasks
22
- - **Date calculations** - Use TaskWarrior's date expressions
16
+ - **Full CRUD operations** - Create, read, update, delete tasks
17
+ - **Type-safe** - Pydantic models with full type hints
18
+ - **Context management** - Define, apply, and switch contexts
19
+ - **UDA support** - User Defined Attributes
20
+ - **Recurring tasks** - Full recurrence support
21
+ - **Annotations** - Add notes to tasks
22
+ - **Date calculations** - Use TaskWarrior's date expressions
23
23
 
24
24
  ## Requirements
25
25
 
@@ -31,7 +31,7 @@ A modern Python wrapper for [TaskWarrior](https://taskwarrior.org/) v3.4, the co
31
31
  ## Installation
32
32
 
33
33
  ```bash
34
- pip install pytaskwarrior==1.0.0
34
+ pip install pytaskwarrior==2.0.0
35
35
  ```
36
36
 
37
37
  Or install from source:
@@ -132,7 +132,7 @@ tw = TaskWarrior(
132
132
 
133
133
  | Method | Description |
134
134
  |--------|-------------|
135
- | `define_context(name, read_filter, write_filter)` | Create a context with read and write filters |
135
+ | `define_context(ctx: ContextDTO)` | Create a context from a ContextDTO (name, read_filter, write_filter) |
136
136
  | `apply_context(name)` | Activate a context |
137
137
  | `unset_context()` | Deactivate current context |
138
138
  | `get_contexts()` | List all contexts |
@@ -140,6 +140,37 @@ tw = TaskWarrior(
140
140
  | `delete_context(name)` | Remove a context |
141
141
  | `has_context(name)` | Check if context exists |
142
142
 
143
+ #### Synchronization Operations
144
+
145
+ | Method | Description |
146
+ |--------|-------------|
147
+ | `is_sync_configured()` | Return `True` if any `sync.*` key is present in configuration (ConfigStore). |
148
+ | `synchronize()` | Run `task sync`; raises `TaskSyncError` if not configured or sync fails. |
149
+
150
+ ### Exceptions
151
+
152
+ All exceptions inherit from `TaskWarriorError` and are importable from the top-level package:
153
+
154
+ ```python
155
+ from taskwarrior import (
156
+ TaskWarriorError, # Base class — catch all library errors
157
+ TaskNotFound, # Task does not exist
158
+ TaskValidationError, # Invalid input data (empty description, etc.)
159
+ TaskOperationError, # Operation failed on an existing task
160
+ TaskConfigurationError, # Environment issue (binary not found, taskrc missing)
161
+ TaskSyncError, # Synchronization failure
162
+ )
163
+ ```
164
+
165
+ | Exception | Raised when |
166
+ |-----------|-------------|
167
+ | `TaskWarriorError` | Base class; catch-all for any library error |
168
+ | `TaskNotFound` | The requested task does not exist |
169
+ | `TaskValidationError` | Input data is invalid (e.g., empty description) |
170
+ | `TaskOperationError` | A write operation failed on an existing task (delete, done, start…) |
171
+ | `TaskConfigurationError` | Environment error (binary not in PATH, taskrc missing/unreadable) |
172
+ | `TaskSyncError` | Sync backend not configured or synchronization failed |
173
+
143
174
  ### Data Models
144
175
 
145
176
  #### TaskInputDTO
@@ -213,9 +244,10 @@ RecurrencePeriod.YEARLY
213
244
  ### Working with Contexts
214
245
 
215
246
  ```python
247
+ from taskwarrior import ContextDTO
216
248
  # Define contexts for different workflows
217
- tw.define_context("work", read_filter="project:work or +urgent", write_filter="project:work or +urgent")
218
- tw.define_context("home", read_filter="project:home or project:personal", write_filter="project:home or project:personal")
249
+ tw.define_context(ContextDTO(name="work", read_filter="project:work or +urgent", write_filter="project:work or +urgent"))
250
+ tw.define_context(ContextDTO(name="home", read_filter="project:home or project:personal", write_filter="project:home or project:personal"))
219
251
 
220
252
  # Switch to work context
221
253
  tw.apply_context("work")
@@ -340,4 +372,3 @@ Contributions are welcome! Please feel free to submit a Pull Request.
340
372
  - [TaskWarrior](https://taskwarrior.org/) - The underlying task management tool
341
373
  - [GitHub Repository](https://github.com/sznicolas/pytaskwarrior/)
342
374
  - [PyPI Package](https://pypi.org/project/pytaskwarrior/)
343
-
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "pytaskwarrior"
3
- version = "1.2.0.dev0"
3
+ version = "2.0.1"
4
4
  description = "Taskwarrior wrapper python module"
5
5
  readme = "PYPI_README.md"
6
6
  requires-python = ">=3.12"
@@ -21,7 +21,6 @@ classifiers = [
21
21
  ]
22
22
  dependencies = [
23
23
  "pydantic>=2.11.7",
24
- "taskchampion-py>=2.0.2",
25
24
  ]
26
25
 
27
26
  [dependency-groups]
@@ -38,7 +37,7 @@ docs = [
38
37
  ]
39
38
 
40
39
  [project.urls]
41
- Homepage = "https://github.com/sznicolas/pytaskwarrior/"
40
+ Homepage = "https://pytaskwarrior.readthedocs.io/en/latest/"
42
41
  Repository = "https://github.com/sznicolas/pytaskwarrior/"
43
42
  Issues = "https://github.com/sznicolas/pytaskwarrior/issues"
44
43
  Changelog = "https://github.com/sznicolas/pytaskwarrior/blob/main/CHANGELOG.md"
@@ -1,10 +1,10 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: pytaskwarrior
3
- Version: 1.2.0.dev0
3
+ Version: 2.0.1
4
4
  Summary: Taskwarrior wrapper python module
5
5
  Author-email: sznicolas <sznicolas@users.noreply.github.com>
6
6
  License-Expression: MIT
7
- Project-URL: Homepage, https://github.com/sznicolas/pytaskwarrior/
7
+ Project-URL: Homepage, https://pytaskwarrior.readthedocs.io/en/latest/
8
8
  Project-URL: Repository, https://github.com/sznicolas/pytaskwarrior/
9
9
  Project-URL: Issues, https://github.com/sznicolas/pytaskwarrior/issues
10
10
  Project-URL: Changelog, https://github.com/sznicolas/pytaskwarrior/blob/main/CHANGELOG.md
@@ -21,7 +21,6 @@ Requires-Python: >=3.12
21
21
  Description-Content-Type: text/markdown
22
22
  License-File: LICENSE
23
23
  Requires-Dist: pydantic>=2.11.7
24
- Requires-Dist: taskchampion-py>=2.0.2
25
24
  Dynamic: license-file
26
25
 
27
26
  # pytaskwarrior
@@ -35,15 +34,16 @@ Dynamic: license-file
35
34
 
36
35
  A modern Python wrapper for [TaskWarrior](https://taskwarrior.org/), the command-line task management tool.
37
36
 
38
- Production-ready with 132 tests (96% coverage), strict type checking, and professional-grade code quality. Zero linting errors, full async-safe subprocess handling, and PEP 561 type hints for IDE support.
37
+ Production-ready with 164 tests (96% coverage), strict type checking, and professional-grade code quality. Zero linting errors, full async-safe subprocess handling, PEP 561 type hints for IDE support, and a consistent exception hierarchy.
39
38
 
40
39
  ## Features
41
40
 
42
- -Full CRUD operations for tasks
43
- -Type-safe with Pydantic models
44
- -Context management
45
- -UDA (User Defined Attributes) support
46
- -Recurring tasks and annotations
41
+ - Full CRUD operations for tasks
42
+ - Type-safe with Pydantic models
43
+ - Context management
44
+ - UDA (User Defined Attributes) support
45
+ - Recurring tasks and annotations
46
+ - Consistent exception hierarchy (`TaskNotFound`, `TaskValidationError`, `TaskOperationError`, `TaskConfigurationError`, …)
47
47
 
48
48
  ## Requirements
49
49
 
@@ -15,18 +15,18 @@ src/taskwarrior/main.py
15
15
  src/taskwarrior/py.typed
16
16
  src/taskwarrior/adapters/__init__.py
17
17
  src/taskwarrior/adapters/taskwarrior_adapter.py
18
+ src/taskwarrior/config/config_store.py
19
+ src/taskwarrior/config/uda_parser.py
18
20
  src/taskwarrior/dto/__init__.py
19
21
  src/taskwarrior/dto/annotation_dto.py
20
22
  src/taskwarrior/dto/context_dto.py
21
23
  src/taskwarrior/dto/task_dto.py
22
24
  src/taskwarrior/dto/uda_dto.py
23
- src/taskwarrior/protocols/sync.py
24
25
  src/taskwarrior/registry/__init__.py
25
26
  src/taskwarrior/registry/uda_registry.py
26
27
  src/taskwarrior/services/__init__.py
27
28
  src/taskwarrior/services/context_service.py
28
29
  src/taskwarrior/services/uda_service.py
29
- src/taskwarrior/sync_backends/sync_local.py
30
30
  src/taskwarrior/utils/__init__.py
31
31
  src/taskwarrior/utils/conversions.py
32
32
  src/taskwarrior/utils/dto_converter.py
@@ -0,0 +1 @@
1
+ pydantic>=2.11.7
@@ -39,6 +39,14 @@ from .dto.context_dto import ContextDTO
39
39
  from .dto.task_dto import TaskInputDTO, TaskOutputDTO
40
40
  from .dto.uda_dto import UdaConfig, UdaType
41
41
  from .enums import Priority, RecurrencePeriod, TaskStatus
42
+ from .exceptions import (
43
+ TaskConfigurationError,
44
+ TaskNotFound,
45
+ TaskOperationError,
46
+ TaskSyncError,
47
+ TaskValidationError,
48
+ TaskWarriorError,
49
+ )
42
50
  from .main import TaskWarrior
43
51
  from .registry.uda_registry import UdaRegistry
44
52
  from .utils.dto_converter import task_output_to_input
@@ -54,12 +62,17 @@ __all__ = [
54
62
  "Priority",
55
63
  "RecurrencePeriod",
56
64
  "TaskStatus",
65
+ "TaskConfigurationError",
57
66
  "TaskInputDTO",
67
+ "TaskNotFound",
68
+ "TaskOperationError",
58
69
  "TaskOutputDTO",
70
+ "TaskSyncError",
71
+ "TaskValidationError",
59
72
  "TaskWarrior",
73
+ "TaskWarriorError",
60
74
  "task_output_to_input",
61
75
  "UdaConfig",
62
76
  "UdaRegistry",
63
77
  "UdaType",
64
78
  ]
65
-