tuxfan-planner 0.2.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.
@@ -0,0 +1,401 @@
1
+ Metadata-Version: 2.4
2
+ Name: tuxfan-planner
3
+ Version: 0.2.0
4
+ Summary: Simple text-driven project planning system
5
+ Requires-Python: >=3.11
6
+ Description-Content-Type: text/markdown
7
+ Requires-Dist: PyYAML>=6.0
8
+ Provides-Extra: docs
9
+ Requires-Dist: Sphinx>=7.2; extra == "docs"
10
+ Requires-Dist: furo; extra == "docs"
11
+
12
+ # Project Planner
13
+
14
+ A small planning system that lets you define project plans and tasks in either YAML or Python.
15
+
16
+ A plan can include optional top-level project metadata:
17
+
18
+ - `portfolio`: portfolio or parent program name.
19
+ - `project`: high-level project name.
20
+ - `managers`: list of manager names.
21
+ - `pocs`: list of point-of-contact names.
22
+ - `summary`: high-level plan summary.
23
+ - `fiscal_range_begin` and `fiscal_range_end`: optional fiscal year range covered by the plan, for example `27` through `31`.
24
+ - `execution`: execution metadata. It can be a mapping with `overview` text and `sections`, where each section has `label`, `description`, and an optional stable `id` for task links. The older flat list of sections is still accepted.
25
+
26
+ Each task supports these fields:
27
+
28
+ - `id`: required string task id. Must contain only letters, numbers, or underscores, with no spaces.
29
+ - `label`: required string display name for the task.
30
+ - `site`: optional site or institution label.
31
+ - `bnr`: optional budget and reporting identifier.
32
+ - `cost`: optional task cost label, for example `$100K`.
33
+ - `funding status` or `funding_status`: optional funding state label.
34
+ - `type`: optional task type label.
35
+ - `tags`: optional comma-separated string or list of task tags.
36
+ - `project`: required string project name.
37
+ - `execution_section`: optional ID of a section under `execution.sections`. Linked tasks use that section's label and position for activity headings and task numbers in exports. An unknown ID is rejected.
38
+ - `description`: required string describing the task.
39
+ - `start`: required fiscal period string in `M{month}Q{quarter}FY{year}` format, where `month` is `1` to `3` within the quarter.
40
+ - `deadline`: required fiscal period string in `M{month}Q{quarter}FY{year}` format, where `month` is `1` to `3` within the quarter.
41
+ - `completed`: optional fiscal period string for work that is already complete. A task with `status: complete` and `completed` may omit planning-only fields: `start`, `deadline`, `expected duration`, `milestone`, `priority`, `dependencies`, and `risk`. Without `completed`, these fields are required.
42
+ - `expected duration` or `expected_duration`: required positive whole number of months.
43
+ - `milestone`: required string milestone name.
44
+ - `priority`: required string priority label such as `low`, `medium`, `high`, or `urgent`.
45
+ - `status`: required string status. Allowed values are `pending`, `active`, `ongoing`, `blocked`, and `complete`.
46
+ - `dependencies`: required list of task ids. Each dependency must reference another task `id`.
47
+ - `risk`: required risk entry or list of risk entries. Each entry has `type`, `level`, and `mitigation`, and may include `description`; `level` must be `low`, `medium`, `high`, or `extreme`.
48
+ - `funding`: optional mapping of fiscal year to funding level, for example `fy27: 50K`. A task is treated as unfunded for fiscal years not present in this mapping.
49
+
50
+ A task can also be a multi-part task by using `parts` instead of the per-task
51
+ schedule fields on the parent. Parent fields such as `project`, `execution_section`, `site`, `bnr`,
52
+ `type`, `tags`, and `funding` are inherited by each part, while each part
53
+ provides its own `id`, `label`, `description`, `start`, `deadline`,
54
+ `expected duration`, `milestone`, `priority`, `status`, `dependencies`, and
55
+ `risk`. Part ids are expanded as `{parent_id}_{part_id}`. Dependencies inside a
56
+ multi-part task can reference sibling part ids, and dependencies from other
57
+ tasks can reference the parent id to depend on all expanded parts. Parent-level
58
+ funding inherited by multiple parts is counted once in fiscal-year totals.
59
+
60
+ ## Quick start
61
+
62
+ Run from this directory:
63
+
64
+ ```bash
65
+ planner validate planner/examples/tasks.yaml
66
+ planner list planner/examples/tasks.yaml
67
+ planner summary planner/examples/tasks.yaml
68
+ planner schedule planner/examples/tasks.yaml
69
+ planner export-docx planner/examples/tasks.yaml /tmp/plan.docx
70
+ planner export-svg planner/examples/tasks.yaml /tmp/plan.svg
71
+ ```
72
+
73
+ If you set `TUXFAN_PLANNER_DATAFILE`, the CLI uses that file by default:
74
+
75
+ ```bash
76
+ export TUXFAN_PLANNER_DATAFILE=planner/examples/tasks.yaml
77
+ planner validate
78
+ planner list
79
+ planner export-docx /tmp/plan.docx
80
+ planner export-svg /tmp/plan.svg
81
+ ```
82
+
83
+ If you set `TUXFAN_PLANNER_EXPORT_OPTIONS`, the export commands use that file by default:
84
+
85
+ ```bash
86
+ export TUXFAN_PLANNER_EXPORT_OPTIONS=planner/examples/export-options.yaml
87
+ planner export-docx planner/examples/tasks.yaml /tmp/plan.docx
88
+ ```
89
+
90
+ You can also install it locally:
91
+
92
+ ```bash
93
+ python3 -m pip install -e .
94
+ planner list planner/examples/tasks.yaml
95
+ ```
96
+
97
+ The legacy `tuxfan-planner` command remains available as an alias.
98
+ Run `planner --help` to see the current values of both planner environment
99
+ variables alongside the command help.
100
+
101
+ ## Shell completion
102
+
103
+ The CLI can print completion scripts for `bash`, `zsh`, and `fish`:
104
+
105
+ ```bash
106
+ planner completion bash
107
+ planner completion zsh
108
+ planner completion fish
109
+ ```
110
+
111
+ For a one-session bash setup:
112
+
113
+ ```bash
114
+ source <(planner completion bash)
115
+ ```
116
+
117
+ The generated completion supports the basic planner subcommands, the
118
+ `tuxfan-planner` alias, file path completion for task and output arguments, and
119
+ `--export-options` for export commands.
120
+
121
+ ## Documentation
122
+
123
+ Sphinx documentation lives in `docs/`. See the
124
+ [developer setup and checks](DEVELOPER.md) for the current dependency and HTML
125
+ build commands.
126
+
127
+ On GitHub, the `Documentation` workflow builds the same Sphinx output and
128
+ publishes it to the `gh-pages` branch. Configure the repository Pages settings
129
+ to serve from the `gh-pages` branch root.
130
+
131
+ ## Updating the virtual environment
132
+
133
+ Follow [Install or upgrade dependencies](DEVELOPER.md#install-or-upgrade-dependencies)
134
+ in the developer guide to update the root `.venv` and check the result.
135
+
136
+ ## YAML format
137
+
138
+ Top-level can be either a list of tasks or a mapping with a `tasks` key. The mapping form can also include plan-level metadata such as `portfolio`, `project`, `managers`, `pocs`, `summary`, `fiscal_range_begin`, `fiscal_range_end`, and `execution`.
139
+
140
+ ```yaml
141
+ portfolio: Advanced Simulation and Computing
142
+ project: Task-Parallel Project
143
+ managers:
144
+ - Alice Example
145
+ pocs:
146
+ - Casey Example, PI
147
+ summary: >
148
+ High-level planning context for the task collection.
149
+ fiscal_range_begin: 27
150
+ fiscal_range_end: 29
151
+ execution:
152
+ overview: >
153
+ Overall execution context for the plan.
154
+ sections:
155
+ - id: deliverable_a
156
+ label: Deliverable A
157
+ description: >
158
+ Narrative execution detail for this deliverable.
159
+
160
+ tasks:
161
+ - id: DraftArchitecture
162
+ label: Draft architecture
163
+ bnr: DP1518130
164
+ cost: $100K
165
+ funding status: funded
166
+ site: LANL
167
+ type: labor
168
+ tags:
169
+ - architecture
170
+ project: Planning System
171
+ execution_section: deliverable_a
172
+ description: Produce the first architecture draft.
173
+ start: M1Q3FY26
174
+ deadline: M2Q3FY26
175
+ expected duration: 2
176
+ milestone: Design
177
+ priority: high
178
+ status: complete
179
+ dependencies: []
180
+ risk:
181
+ - type: scope
182
+ level: medium
183
+ description: Integration requirements may change during implementation.
184
+ mitigation: Review the architecture with stakeholders before implementation starts.
185
+ funding:
186
+ fy27: 50K
187
+ fy29: 100K
188
+
189
+ - id: BuildParser
190
+ label: Build parser
191
+ project: Planning System
192
+ description: Load task definitions from YAML and Python files.
193
+ start: M2Q3FY26
194
+ deadline: M2Q3FY26
195
+ expected_duration: 1
196
+ milestone: Implementation
197
+ priority: high
198
+ status: pending
199
+ dependencies:
200
+ - DraftArchitecture
201
+ risk:
202
+ - type: integration
203
+ level: medium
204
+ mitigation: Add schema validation tests for both YAML and Python task sources.
205
+
206
+ - id: MultiYearDelivery
207
+ label: Multi-year delivery
208
+ site: LANL
209
+ project: Planning System
210
+ funding:
211
+ fy27: 50K
212
+ fy28: 100K
213
+ parts:
214
+ - id: A
215
+ label: First phase
216
+ description: Complete the first phase.
217
+ start: M1Q1FY27
218
+ deadline: M3Q2FY27
219
+ expected duration: 6
220
+ milestone: Phase A
221
+ priority: high
222
+ status: active
223
+ dependencies: []
224
+ risk:
225
+ - type: schedule
226
+ level: low
227
+ mitigation: Review progress monthly.
228
+ - id: B
229
+ label: Second phase
230
+ description: Complete the second phase.
231
+ start: M1Q3FY27
232
+ deadline: M3Q4FY28
233
+ expected duration: 18
234
+ milestone: Phase B
235
+ priority: medium
236
+ status: pending
237
+ dependencies:
238
+ - A
239
+ risk:
240
+ - type: technical
241
+ level: medium
242
+ mitigation: Keep integration tests current.
243
+ ```
244
+
245
+ ## Python format
246
+
247
+ Define `PLAN` or `plan` in a `.py` file for metadata plus tasks. The legacy `TASKS` or `tasks` list still works.
248
+
249
+ ```python
250
+ PLAN = {
251
+ "portfolio": "Advanced Simulation and Computing",
252
+ "project": "Task-Parallel Project",
253
+ "managers": ["Alice Example"],
254
+ "pocs": ["Casey Example, PI"],
255
+ "summary": "High-level planning context for the task collection.",
256
+ "fiscal_range_begin": 27,
257
+ "fiscal_range_end": 29,
258
+ "execution": {
259
+ "overview": "Overall execution context for the plan.",
260
+ "sections": [
261
+ {
262
+ "id": "deliverable_a",
263
+ "label": "Deliverable A",
264
+ "description": "Narrative execution detail for this deliverable.",
265
+ }
266
+ ],
267
+ },
268
+ "tasks": [
269
+ {
270
+ "id": "DraftArchitecture",
271
+ "label": "Draft architecture",
272
+ "bnr": "DP1518130",
273
+ "cost": "$100K",
274
+ "funding_status": "funded",
275
+ "site": "LANL",
276
+ "type": "labor",
277
+ "tags": ["architecture"],
278
+ "project": "Planning System",
279
+ "execution_section": "deliverable_a",
280
+ "description": "Produce the first architecture draft.",
281
+ "start": "M1Q3FY26",
282
+ "deadline": "M2Q3FY26",
283
+ "expected_duration": 2,
284
+ "milestone": "Design",
285
+ "priority": "high",
286
+ "status": "complete",
287
+ "dependencies": [],
288
+ "risk": [
289
+ {
290
+ "type": "scope",
291
+ "level": "medium",
292
+ "mitigation": "Review the architecture with stakeholders before implementation starts.",
293
+ }
294
+ ],
295
+ "funding": {"fy27": "50K", "fy29": "100K"},
296
+ }
297
+ ],
298
+ }
299
+ ```
300
+
301
+ ## Status values
302
+
303
+ Use one of:
304
+
305
+ - `pending`
306
+ - `active`
307
+ - `ongoing`
308
+ - `blocked`
309
+ - `complete`
310
+
311
+ ## Fiscal period values
312
+
313
+ `start` and `deadline` must use `M{month}Q{quarter}FY{year}`:
314
+
315
+ - `month` is `1` to `3` within the quarter
316
+ - `quarter` is `1` to `4`
317
+ - `year` is a 2-digit fiscal year, for example `FY26`
318
+
319
+ Fiscal years begin on October 1:
320
+
321
+ - `Q1` = October through December
322
+ - `Q2` = January through March
323
+ - `Q3` = April through June
324
+ - `Q4` = July through September
325
+
326
+ Examples:
327
+
328
+ - `M1Q1FY26` = October 2025
329
+ - `M2Q3FY26` = May 2026
330
+ - `M3Q4FY26` = September 2026
331
+
332
+ ## Commands
333
+
334
+ - `validate`: checks required fields, invalid status values, invalid fiscal period or duration values, invalid ids, duplicate ids, missing dependencies, and dependency cycles
335
+ - `list`: prints task details in deadline order by default, including fiscal start and deadline values and expected duration in months
336
+ - `summary`: groups tasks by project and milestone and prints funding totals when task funding is present
337
+ - `schedule`: prints tasks in dependency order and marks them as `READY`, `BLOCKED`, `ACTIVE`, or `COMPLETE`
338
+ - `export-docx`: generates a Word document with the schedule and a detailed task table. Use `--export-options PATH` or `TUXFAN_PLANNER_EXPORT_OPTIONS` to control which optional task attributes appear in the summary table and in the per-task narrative metadata. The table starts on a new page with its section headings. When fiscal years are configured, it includes one column per fiscal year with each task's funding level or a blank cell when the task is not funded in that year, plus a final total row.
339
+ - `export-svg`: generates a graphical SVG plan with the same activity letters and task numbers as Word. It shows configured fiscal-year funding totals, completion years, and dependency task numbers. Fill color reflects status, border color uses the Word risk colors, and an accent bar reflects priority. Export options select which optional task attributes appear on cards; custom column labels and alignment apply only to Word.
340
+
341
+ ## Export options
342
+
343
+ Export options files can be YAML, YML, or Python. The current supported settings are `task_table_attributes` and `task_table_columns`, which control the optional task attribute columns included in the Word export summary table and the attributes shown on SVG task cards. Custom labels and alignment apply only to Word. The `.docx` table always starts with an unlabeled column containing generated task numbers; it does not include a Project column. An `Activity A`, `Activity B`, etc. row precedes each activity's tasks, which appear in numeric task order. When tasks link to execution sections, the activity row includes the section label and its letter follows section order (for example, `Activity B: Specialization Work` with `Task B.1`). Unlinked tasks follow in project-based groups; plans without links keep their existing project-based grouping. Each activity label occupies one left-aligned cell spanning the table. The column header repeats only when the table continues onto another page; Activity rows appear at their normal group transitions. All table cells center their content vertically. Fiscal-year columns are added automatically when plan fiscal years are configured, with a final `Total Funding` row that sums each year and counts inherited multipart funding once. For completed tasks, those columns become one green-filled cell labeled with the completion year (for example, `Completed FY26`) when a `completed` period is available, or `Completed` otherwise; the other cells remain black on white. The other task metadata columns and per-task attribute narrative are limited to the attributes listed here.
344
+
345
+ In the Word risk mitigation section, the bold risk label is green for `low`, yellow for `medium`, orange for `high`, and deep red for `extreme`. Mitigation text remains black.
346
+
347
+ Top-level Word section labels, including `Tasks:`, are bold and underlined.
348
+
349
+ Supported attribute names:
350
+
351
+ - `bnr`
352
+ - `cost`
353
+ - `funding` or `funding_status`
354
+ - `site`
355
+ - `type`
356
+ - `tags`
357
+
358
+ Simple YAML:
359
+
360
+ ```yaml
361
+ task_table_attributes:
362
+ - site
363
+ - bnr
364
+ - funding
365
+ - tags
366
+ ```
367
+
368
+ Shorthand YAML with custom labels:
369
+
370
+ ```yaml
371
+ task_table_attributes:
372
+ - bnr: BNR
373
+ - funding: Status
374
+ - tags: Keywords
375
+ ```
376
+
377
+ Recommended explicit YAML when you need labels or alignment:
378
+
379
+ ```yaml
380
+ task_table_columns:
381
+ - attribute: bnr
382
+ label: BNR
383
+ - attribute: funding
384
+ label: Status
385
+ - attribute: tags
386
+ label: Keywords
387
+ ```
388
+
389
+ Supported column alignment values:
390
+
391
+ - `left`
392
+ - `center`
393
+ - `right`
394
+
395
+ `alignment` is optional and defaults to `center`.
396
+
397
+ Example CLI usage:
398
+
399
+ ```bash
400
+ planner export-docx planner/examples/tasks.yaml /tmp/plan.docx --export-options planner/examples/export-options.yaml
401
+ ```