gtd-tui 0.1.0__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 (41) hide show
  1. gtd_tui-0.1.0/LICENSE +21 -0
  2. gtd_tui-0.1.0/PKG-INFO +160 -0
  3. gtd_tui-0.1.0/README.md +142 -0
  4. gtd_tui-0.1.0/pyproject.toml +82 -0
  5. gtd_tui-0.1.0/setup.cfg +4 -0
  6. gtd_tui-0.1.0/src/gtd/__init__.py +1 -0
  7. gtd_tui-0.1.0/src/gtd/api.py +556 -0
  8. gtd_tui-0.1.0/src/gtd/cli.py +521 -0
  9. gtd_tui-0.1.0/src/gtd/gtd_tui.py +3966 -0
  10. gtd_tui-0.1.0/src/gtd/notion/__init__.py +1 -0
  11. gtd_tui-0.1.0/src/gtd/notion/capture.py +62 -0
  12. gtd_tui-0.1.0/src/gtd/notion/client.py +492 -0
  13. gtd_tui-0.1.0/src/gtd/notion/commands.py +153 -0
  14. gtd_tui-0.1.0/src/gtd/notion/config.py +26 -0
  15. gtd_tui-0.1.0/src/gtd/notion/display.py +31 -0
  16. gtd_tui-0.1.0/src/gtd/notion/entries.py +444 -0
  17. gtd_tui-0.1.0/src/gtd/notion/init.py +284 -0
  18. gtd_tui-0.1.0/src/gtd/notion/log.py +127 -0
  19. gtd_tui-0.1.0/src/gtd/notion/models.py +117 -0
  20. gtd_tui-0.1.0/src/gtd/notion/review.py +281 -0
  21. gtd_tui-0.1.0/src/gtd/notion/schema.py +53 -0
  22. gtd_tui-0.1.0/src/gtd/notion/today.py +145 -0
  23. gtd_tui-0.1.0/src/gtd/notion/triage.py +253 -0
  24. gtd_tui-0.1.0/src/gtd/storage.py +84 -0
  25. gtd_tui-0.1.0/src/gtd/tui.py +431 -0
  26. gtd_tui-0.1.0/src/gtd/ui.py +86 -0
  27. gtd_tui-0.1.0/src/gtd_tui.egg-info/PKG-INFO +160 -0
  28. gtd_tui-0.1.0/src/gtd_tui.egg-info/SOURCES.txt +39 -0
  29. gtd_tui-0.1.0/src/gtd_tui.egg-info/dependency_links.txt +1 -0
  30. gtd_tui-0.1.0/src/gtd_tui.egg-info/entry_points.txt +2 -0
  31. gtd_tui-0.1.0/src/gtd_tui.egg-info/requires.txt +8 -0
  32. gtd_tui-0.1.0/src/gtd_tui.egg-info/top_level.txt +1 -0
  33. gtd_tui-0.1.0/tests/test_areas_cli.py +85 -0
  34. gtd_tui-0.1.0/tests/test_gtd_tui.py +553 -0
  35. gtd_tui-0.1.0/tests/test_notion.py +499 -0
  36. gtd_tui-0.1.0/tests/test_notion_client.py +373 -0
  37. gtd_tui-0.1.0/tests/test_notion_entries.py +360 -0
  38. gtd_tui-0.1.0/tests/test_notion_init.py +259 -0
  39. gtd_tui-0.1.0/tests/test_steps.py +117 -0
  40. gtd_tui-0.1.0/tests/test_storage.py +252 -0
  41. gtd_tui-0.1.0/tests/test_ui.py +45 -0
gtd_tui-0.1.0/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Danny Brown
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
gtd_tui-0.1.0/PKG-INFO ADDED
@@ -0,0 +1,160 @@
1
+ Metadata-Version: 2.4
2
+ Name: gtd-tui
3
+ Version: 0.1.0
4
+ Summary: GTD + 12-Week Year CLI powered by Notion
5
+ License-Expression: MIT
6
+ Project-URL: Repository, https://github.com/dannybrown37/gtd
7
+ Requires-Python: >=3.12
8
+ Description-Content-Type: text/markdown
9
+ License-File: LICENSE
10
+ Requires-Dist: click>=8.1.0
11
+ Requires-Dist: httpx>=0.28.0
12
+ Requires-Dist: pydantic>=2.13.4
13
+ Requires-Dist: python-dateutil>=2.9.0.post0
14
+ Requires-Dist: textual>=0.71.0
15
+ Provides-Extra: api
16
+ Requires-Dist: flask>=3.1.0; extra == "api"
17
+ Dynamic: license-file
18
+
19
+ # The Getting Things Done Terminal User Interface
20
+
21
+ A TUI/CLI/API for personal productivity built around [GTD (Getting Things Done)](https://gettingthingsdone.com/).
22
+
23
+ ## What it does
24
+
25
+ - Capture items to an inbox and triage them into projects
26
+ - Track projects with contexts, next actions, and follow-up dates
27
+ - Log completions and auto-reschedule recurring items
28
+ - Defer, snooze, and review Someday/Maybe lists
29
+ - Filter by context for focused work sessions
30
+
31
+ ## Requirements
32
+
33
+ - Python 3.12+
34
+ - [fzf](https://github.com/junegunn/fzf) (for interactive menus)
35
+ - A [Notion integration token](https://developers.notion.com/) (for `gtd`)
36
+
37
+ ## Installation
38
+
39
+ ```bash
40
+ cd gtd
41
+ uv sync
42
+ uv pip install -e .
43
+ ```
44
+
45
+ This installs the `gtd` command.
46
+
47
+ ## Usage
48
+
49
+ ### GTD interactive mode
50
+
51
+ ```bash
52
+ gtd
53
+ ```
54
+
55
+ Opens the fzf-powered GTD menu:
56
+
57
+ <!-- BEGIN MENU -->
58
+ | Category | Action |
59
+ | --- | --- |
60
+ | Do | Today |
61
+ | Do | Log & Reschedule |
62
+ | Do | Snooze until tomorrow |
63
+ | Do | Capture new item |
64
+ | Do | Brain dump |
65
+ | Do | Triage inbox |
66
+ | Manage | Update project |
67
+ | Manage | Defer project until date |
68
+ | Manage | Waiting For |
69
+ | Manage | Mark done (delete) |
70
+ | Review | Weekly Review |
71
+ | Review | Review Someday/Maybe |
72
+ | View | View all projects |
73
+ | View | Filter by context |
74
+ <!-- END MENU -->
75
+
76
+ ### GTD subcommands
77
+
78
+ ```bash
79
+ gtd init # Set up a new GTD Notion database
80
+ gtd init --upgrade # Add missing properties/options to existing DB
81
+ gtd triage # Process inbox items
82
+ gtd review # Guided weekly review ritual
83
+ gtd dump # Rapid-fire brain dump
84
+ gtd filter work # Filter projects by context
85
+ gtd today # Show today's actionable items
86
+ gtd capture # Quick-capture to inbox
87
+ gtd done # Mark a project as done
88
+ gtd update # Update project fields
89
+ gtd defer # Defer a project
90
+ ```
91
+
92
+ ## HTTP API
93
+
94
+ A small Flask app (`gtd api`) exposes GTD operations over HTTP, primarily so
95
+ you can drive `gtd` from **iOS Shortcuts** (or any other HTTP client) without
96
+ opening a terminal — capture a thought, check today's actionable items, or
97
+ triage the inbox from your phone.
98
+
99
+ There's no central server in the loop: you run this yourself, against your own
100
+ Notion integration and database. Your GTD data lives in your Notion account under
101
+ your own token.
102
+
103
+
104
+ **Install**: `uv pip install "gtd[api]"`
105
+ **Run**: `gtd api` (default `0.0.0.0:8000`) or `gtd api --port 9000`
106
+ **Auth**: Bearer token — set `GTD_API_KEY` on the server, then pass
107
+ `Authorization: Bearer <key>` on every request.
108
+
109
+ <!-- BEGIN API MENU -->
110
+ | Method | Path | Description |
111
+ | --- | --- | --- |
112
+ | `POST` | `/capture` | Add an item to the inbox. Body: {"header": "..."}. |
113
+ | `GET` | `/contexts` | Get active contexts. |
114
+ | `GET` | `/inbox` | Get all Triage entries (inbox). |
115
+ | `GET` | `/list-categories` | Return canonical list categories from Notion (for debugging/UI use). |
116
+ | `GET` | `/list/<category>` | Get all entries in a specific list category. |
117
+ | `GET` | `/next-steps` | Get actionable next steps, optionally filtered by context. |
118
+ | `GET` | `/triage-schema` | Get schema for triage workflow: statuses and contexts per status. |
119
+ | `POST` | `/triage/<page_id>` | Atomically triage an entry with full data. |
120
+ <!-- END API MENU -->
121
+
122
+ ## Updating this README
123
+
124
+ The menu table and the HTTP API table above are both extracted from source
125
+ (`cli.py`'s `menu_items` and the `@app.get`/`@app.post`/... routes in
126
+ `api.py`, respectively). After changing either, regenerate both:
127
+
128
+ ```bash
129
+ python scripts/update_readme.py
130
+ ```
131
+
132
+ A pre-commit hook (`sync-readme`) runs this automatically whenever `cli.py`,
133
+ `api.py`, or `README.md` changes, so the tables shouldn't drift in practice.
134
+
135
+ ## Data storage
136
+
137
+ - **GTD**: Notion database (configured via `gtd init` or `NOTION_NOTES_TOKEN` / `NOTION_PROJECTS_DB_ID` env vars)
138
+ - **Weekly review state, Areas of Focus, list categories**: JSON files in `~/.local/share/gtd/`
139
+
140
+ ## Project structure
141
+
142
+ ```
143
+ src/gtd/
144
+ ├── gtd.py # GTD interactive menu and CLI commands
145
+ ├── gtd_tui.py # Textual TUI
146
+ ├── storage.py # File I/O and path management
147
+ ├── ui.py # fzf helpers, prompts, formatting
148
+ └── notion/
149
+ ├── client.py # Notion API client
150
+ ├── config.py # Config file management (~/.config/gtd/)
151
+ ├── schema.py # Database schema definition
152
+ ├── init.py # Database creation and upgrades
153
+ ├── models.py # ProjectEntry dataclass
154
+ ├── commands.py # GTD command implementations
155
+ ├── capture.py # Inbox capture
156
+ ├── triage.py # Triage processing
157
+ └── display.py # Entry formatting
158
+ scripts/
159
+ └── update_readme.py # Auto-update README menu section
160
+ ```
@@ -0,0 +1,142 @@
1
+ # The Getting Things Done Terminal User Interface
2
+
3
+ A TUI/CLI/API for personal productivity built around [GTD (Getting Things Done)](https://gettingthingsdone.com/).
4
+
5
+ ## What it does
6
+
7
+ - Capture items to an inbox and triage them into projects
8
+ - Track projects with contexts, next actions, and follow-up dates
9
+ - Log completions and auto-reschedule recurring items
10
+ - Defer, snooze, and review Someday/Maybe lists
11
+ - Filter by context for focused work sessions
12
+
13
+ ## Requirements
14
+
15
+ - Python 3.12+
16
+ - [fzf](https://github.com/junegunn/fzf) (for interactive menus)
17
+ - A [Notion integration token](https://developers.notion.com/) (for `gtd`)
18
+
19
+ ## Installation
20
+
21
+ ```bash
22
+ cd gtd
23
+ uv sync
24
+ uv pip install -e .
25
+ ```
26
+
27
+ This installs the `gtd` command.
28
+
29
+ ## Usage
30
+
31
+ ### GTD interactive mode
32
+
33
+ ```bash
34
+ gtd
35
+ ```
36
+
37
+ Opens the fzf-powered GTD menu:
38
+
39
+ <!-- BEGIN MENU -->
40
+ | Category | Action |
41
+ | --- | --- |
42
+ | Do | Today |
43
+ | Do | Log & Reschedule |
44
+ | Do | Snooze until tomorrow |
45
+ | Do | Capture new item |
46
+ | Do | Brain dump |
47
+ | Do | Triage inbox |
48
+ | Manage | Update project |
49
+ | Manage | Defer project until date |
50
+ | Manage | Waiting For |
51
+ | Manage | Mark done (delete) |
52
+ | Review | Weekly Review |
53
+ | Review | Review Someday/Maybe |
54
+ | View | View all projects |
55
+ | View | Filter by context |
56
+ <!-- END MENU -->
57
+
58
+ ### GTD subcommands
59
+
60
+ ```bash
61
+ gtd init # Set up a new GTD Notion database
62
+ gtd init --upgrade # Add missing properties/options to existing DB
63
+ gtd triage # Process inbox items
64
+ gtd review # Guided weekly review ritual
65
+ gtd dump # Rapid-fire brain dump
66
+ gtd filter work # Filter projects by context
67
+ gtd today # Show today's actionable items
68
+ gtd capture # Quick-capture to inbox
69
+ gtd done # Mark a project as done
70
+ gtd update # Update project fields
71
+ gtd defer # Defer a project
72
+ ```
73
+
74
+ ## HTTP API
75
+
76
+ A small Flask app (`gtd api`) exposes GTD operations over HTTP, primarily so
77
+ you can drive `gtd` from **iOS Shortcuts** (or any other HTTP client) without
78
+ opening a terminal — capture a thought, check today's actionable items, or
79
+ triage the inbox from your phone.
80
+
81
+ There's no central server in the loop: you run this yourself, against your own
82
+ Notion integration and database. Your GTD data lives in your Notion account under
83
+ your own token.
84
+
85
+
86
+ **Install**: `uv pip install "gtd[api]"`
87
+ **Run**: `gtd api` (default `0.0.0.0:8000`) or `gtd api --port 9000`
88
+ **Auth**: Bearer token — set `GTD_API_KEY` on the server, then pass
89
+ `Authorization: Bearer <key>` on every request.
90
+
91
+ <!-- BEGIN API MENU -->
92
+ | Method | Path | Description |
93
+ | --- | --- | --- |
94
+ | `POST` | `/capture` | Add an item to the inbox. Body: {"header": "..."}. |
95
+ | `GET` | `/contexts` | Get active contexts. |
96
+ | `GET` | `/inbox` | Get all Triage entries (inbox). |
97
+ | `GET` | `/list-categories` | Return canonical list categories from Notion (for debugging/UI use). |
98
+ | `GET` | `/list/<category>` | Get all entries in a specific list category. |
99
+ | `GET` | `/next-steps` | Get actionable next steps, optionally filtered by context. |
100
+ | `GET` | `/triage-schema` | Get schema for triage workflow: statuses and contexts per status. |
101
+ | `POST` | `/triage/<page_id>` | Atomically triage an entry with full data. |
102
+ <!-- END API MENU -->
103
+
104
+ ## Updating this README
105
+
106
+ The menu table and the HTTP API table above are both extracted from source
107
+ (`cli.py`'s `menu_items` and the `@app.get`/`@app.post`/... routes in
108
+ `api.py`, respectively). After changing either, regenerate both:
109
+
110
+ ```bash
111
+ python scripts/update_readme.py
112
+ ```
113
+
114
+ A pre-commit hook (`sync-readme`) runs this automatically whenever `cli.py`,
115
+ `api.py`, or `README.md` changes, so the tables shouldn't drift in practice.
116
+
117
+ ## Data storage
118
+
119
+ - **GTD**: Notion database (configured via `gtd init` or `NOTION_NOTES_TOKEN` / `NOTION_PROJECTS_DB_ID` env vars)
120
+ - **Weekly review state, Areas of Focus, list categories**: JSON files in `~/.local/share/gtd/`
121
+
122
+ ## Project structure
123
+
124
+ ```
125
+ src/gtd/
126
+ ├── gtd.py # GTD interactive menu and CLI commands
127
+ ├── gtd_tui.py # Textual TUI
128
+ ├── storage.py # File I/O and path management
129
+ ├── ui.py # fzf helpers, prompts, formatting
130
+ └── notion/
131
+ ├── client.py # Notion API client
132
+ ├── config.py # Config file management (~/.config/gtd/)
133
+ ├── schema.py # Database schema definition
134
+ ├── init.py # Database creation and upgrades
135
+ ├── models.py # ProjectEntry dataclass
136
+ ├── commands.py # GTD command implementations
137
+ ├── capture.py # Inbox capture
138
+ ├── triage.py # Triage processing
139
+ └── display.py # Entry formatting
140
+ scripts/
141
+ └── update_readme.py # Auto-update README menu section
142
+ ```
@@ -0,0 +1,82 @@
1
+ [project]
2
+ name = "gtd-tui"
3
+ version = "0.1.0"
4
+ description = "GTD + 12-Week Year CLI powered by Notion"
5
+ readme = "README.md"
6
+ license = "MIT"
7
+ requires-python = ">=3.12"
8
+ dependencies = ["click>=8.1.0", "httpx>=0.28.0", "pydantic>=2.13.4", "python-dateutil>=2.9.0.post0", "textual>=0.71.0"]
9
+
10
+ [project.urls]
11
+ Repository = "https://github.com/dannybrown37/gtd"
12
+
13
+ [project.optional-dependencies]
14
+ api = ["flask>=3.1.0"]
15
+
16
+
17
+ [project.scripts]
18
+ gtd = "gtd.cli:main"
19
+
20
+
21
+ [tool.setuptools.packages.find]
22
+ where = ["src"]
23
+
24
+
25
+ [build-system]
26
+ requires = ["setuptools>=75.0"]
27
+ build-backend = "setuptools.build_meta"
28
+
29
+
30
+ [tool.ruff]
31
+ line-length = 79
32
+ show-fixes = true
33
+ target-version = "py312"
34
+
35
+ [tool.ruff.lint]
36
+ select = [
37
+ "A", "ANN", "ARG", "B", "C4", "COM", "C90",
38
+ "D200", "D201", "D202", "D205", "D212",
39
+ "E", "EM", "ERA", "EXE", "F", "FBT", "G", "I", "ICN", "ISC", "N",
40
+ "PGH", "PIE", "PL", "PLE", "PLR", "PLW", "PT", "PTH", "PYI", "Q",
41
+ "RET", "RSE", "RUF", "S", "SLF", "SIM", "TCH", "TID", "TRY", "W",
42
+ "UP", "YTT",
43
+ ]
44
+ ignore = [
45
+ "S311",
46
+ "S101",
47
+ "I001",
48
+ "S113",
49
+ "PLR0913",
50
+ "PLC0415",
51
+ "COM812", # conflicts with formatter
52
+ "FBT001", # click uses bool positional args by design
53
+ ]
54
+
55
+ [tool.ruff.lint.flake8-quotes]
56
+ inline-quotes = "single"
57
+
58
+ [tool.ruff.lint.per-file-ignores]
59
+ "test_*.py" = ["ANN201", "PLR2004", "ANN001", "ANN003", "ARG002", "PT019"]
60
+ "tests/**" = ["ANN201", "PLR2004", "ANN001", "ANN003", "ARG002", "PT019"]
61
+ "api.py" = ["ANN401"]
62
+
63
+ [tool.ruff.format]
64
+ quote-style = "single"
65
+ docstring-code-format = true
66
+
67
+ [dependency-groups]
68
+ dev = [
69
+ "commitizen>=4.10.0",
70
+ "pytest>=9.1.1",
71
+ "pytest-cov>=7.1.0",
72
+ ]
73
+
74
+ [tool.commitizen]
75
+ name = "cz_conventional_commits"
76
+ version_provider = "pep621"
77
+ tag_format = "v$version"
78
+ major_version_zero = true
79
+ # BOOTSTRAP ONLY: true crashes `cz bump` with NoRevisionError when the repo
80
+ # has zero tags (incremental changelog has nothing to diff against). Flip
81
+ # back to true in a follow-up commit once v0.1.0 exists.
82
+ update_changelog_on_bump = false
@@ -0,0 +1,4 @@
1
+ [egg_info]
2
+ tag_build =
3
+ tag_date = 0
4
+
@@ -0,0 +1 @@
1
+ """A CLI for the Getting Things Done (GTD) method."""