worklog-opsdevnz 0.1.0__tar.gz → 0.1.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 (21) hide show
  1. {worklog_opsdevnz-0.1.0 → worklog_opsdevnz-0.1.1}/PKG-INFO +20 -43
  2. worklog_opsdevnz-0.1.1/README.md +71 -0
  3. {worklog_opsdevnz-0.1.0 → worklog_opsdevnz-0.1.1}/pyproject.toml +1 -1
  4. {worklog_opsdevnz-0.1.0 → worklog_opsdevnz-0.1.1}/src/worklog_opsdevnz/cli.py +7 -7
  5. {worklog_opsdevnz-0.1.0 → worklog_opsdevnz-0.1.1}/src/worklog_opsdevnz.egg-info/PKG-INFO +20 -43
  6. {worklog_opsdevnz-0.1.0 → worklog_opsdevnz-0.1.1}/tests/test_cli.py +22 -0
  7. worklog_opsdevnz-0.1.0/README.md +0 -94
  8. {worklog_opsdevnz-0.1.0 → worklog_opsdevnz-0.1.1}/LICENSE +0 -0
  9. {worklog_opsdevnz-0.1.0 → worklog_opsdevnz-0.1.1}/setup.cfg +0 -0
  10. {worklog_opsdevnz-0.1.0 → worklog_opsdevnz-0.1.1}/src/worklog_opsdevnz/__init__.py +0 -0
  11. {worklog_opsdevnz-0.1.0 → worklog_opsdevnz-0.1.1}/src/worklog_opsdevnz/config.py +0 -0
  12. {worklog_opsdevnz-0.1.0 → worklog_opsdevnz-0.1.1}/src/worklog_opsdevnz/paths.py +0 -0
  13. {worklog_opsdevnz-0.1.0 → worklog_opsdevnz-0.1.1}/src/worklog_opsdevnz/template.py +0 -0
  14. {worklog_opsdevnz-0.1.0 → worklog_opsdevnz-0.1.1}/src/worklog_opsdevnz.egg-info/SOURCES.txt +0 -0
  15. {worklog_opsdevnz-0.1.0 → worklog_opsdevnz-0.1.1}/src/worklog_opsdevnz.egg-info/dependency_links.txt +0 -0
  16. {worklog_opsdevnz-0.1.0 → worklog_opsdevnz-0.1.1}/src/worklog_opsdevnz.egg-info/entry_points.txt +0 -0
  17. {worklog_opsdevnz-0.1.0 → worklog_opsdevnz-0.1.1}/src/worklog_opsdevnz.egg-info/requires.txt +0 -0
  18. {worklog_opsdevnz-0.1.0 → worklog_opsdevnz-0.1.1}/src/worklog_opsdevnz.egg-info/top_level.txt +0 -0
  19. {worklog_opsdevnz-0.1.0 → worklog_opsdevnz-0.1.1}/tests/test_config.py +0 -0
  20. {worklog_opsdevnz-0.1.0 → worklog_opsdevnz-0.1.1}/tests/test_paths.py +0 -0
  21. {worklog_opsdevnz-0.1.0 → worklog_opsdevnz-0.1.1}/tests/test_template.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: worklog-opsdevnz
3
- Version: 0.1.0
3
+ Version: 0.1.1
4
4
  Summary: Configurable worklog management CLI for dated development logs
5
5
  Author-email: "OpsDev.nz Collective" <john@opsdev.nz>
6
6
  License: Apache-2.0
@@ -31,41 +31,21 @@ Requires-Dist: ruff>=0.4; extra == "dev"
31
31
  Requires-Dist: mypy>=1.0; extra == "dev"
32
32
  Dynamic: license-file
33
33
 
34
- # WorkLog OpsDev.NZ
35
-
36
- **Status:** Development — see pyproject.toml for version
34
+ # worklog-opsdevnz
37
35
 
38
36
  Configurable CLI tool for creating and managing dated development worklogs.
39
37
  Generates Markdown entries with YAML frontmatter from per-project templates.
40
38
 
41
- ## Problem
42
-
43
- Across multiple projects we kept reinventing the same pattern: a script that
44
- creates a dated Markdown file from a template, with frontmatter for date,
45
- author, tags, and draft status. Each implementation had slightly different
46
- directory structures, section headers, and filenames. The core concept was
47
- always the same.
48
-
49
- ## Solution
50
-
51
- `worklog-opsdevnz` formalises this pattern into a single published module:
52
-
53
- - **Per-project config** — `worklog.toml` controls directory structure, sections,
54
- author, tags, and filename patterns
55
- - **Three structure modes** — `flat`, `year`, or `year-month` directory layouts
56
- - **YAML frontmatter** — date, title, author, tags, draft status
57
- - **Configurable sections** — each project defines its own section headers
58
- - **Editor integration** — opens new entries in `$VISUAL` / `$EDITOR`
59
- - **List existing entries** — browse worklogs with `--list`
60
-
61
39
  ## Quick Start
62
40
 
63
41
  ```bash
42
+ pip install worklog-opsdevnz
43
+
64
44
  # Create today's worklog
65
45
  worklog-opsdevnz
66
46
 
67
- # Create yesterday's worklog
68
- worklog-opsdevnz --previous
47
+ # Show installed version
48
+ worklog-opsdevnz --version
69
49
 
70
50
  # Override the editor for this run
71
51
  worklog-opsdevnz --editor nvim
@@ -79,6 +59,7 @@ Each project gets a `worklog.toml` at its root:
79
59
  worklog_dir = "docs/worklog"
80
60
  structure = "year" # "flat", "year", or "year-month"
81
61
  author = "Your Name"
62
+ editor = "nvim" # optional, overridden by -e / $VISUAL / $EDITOR
82
63
  default_tags = ["worklog", "log"]
83
64
 
84
65
  [[sections]]
@@ -94,34 +75,30 @@ title = "Notes"
94
75
  title = "Next"
95
76
  ```
96
77
 
97
- ## Scope
78
+ ## Features
98
79
 
99
- **WorkLog DOES:**
100
- - Create dated Markdown worklog entries with YAML frontmatter
101
80
  - Per-project configuration via `worklog.toml`
102
- - Open entries in configured editor (`$VISUAL` / `$EDITOR`)
103
- - Three directory structure modes: flat, year, year-month
104
-
105
- **WorkLog DOES NOT (out of scope for 0.0.2):**
106
- - Zensical blog integration (see design doc)
107
- - Auto-generated index pages
108
- - Retro template support (planned for 0.1.0)
109
- - Time tracking / timesheet aggregation
110
- - `list`, `init`, or `create` subcommands (planned for 0.1.0)
81
+ - Three directory structure modes: `flat`, `year`, `year-month`
82
+ - YAML frontmatter: date, author, tags, draft status
83
+ - Configurable section headers per project
84
+ - Editor integration: `-e` flag config → `$VISUAL` → `$EDITOR`
85
+ - `--version` flag for installed version
111
86
 
112
87
  ## Requirements
113
88
 
114
89
  - Python 3.12+
115
90
  - See [pyproject.toml](pyproject.toml) for full dependencies
116
91
 
117
- ## Related
92
+ ## Documentation
118
93
 
94
+ - [Release Process](docs/release-process.md)
119
95
  - [Functional Requirements](docs/specs/README.md)
96
+ - [Non-Functional Requirements](docs/specs/NFR.md)
120
97
  - [Design Decisions](docs/design/README.md)
121
98
  - [User Stories](docs/stories/README.md)
122
99
 
123
- ---
100
+ ## Related
124
101
 
125
- **Last Updated:** 2026-05-23
126
- **Status:** Development (migrated to module template)
127
- **Maintainer:** OpsDev.nz Collective
102
+ - [PyPI](https://pypi.org/project/worklog-opsdevnz/)
103
+ - [GitHub](https://github.com/startmeup-nz/worklog_opsdevnz)
104
+ - [OpsDev.nz Collective](https://opsdev.nz)
@@ -0,0 +1,71 @@
1
+ # worklog-opsdevnz
2
+
3
+ Configurable CLI tool for creating and managing dated development worklogs.
4
+ Generates Markdown entries with YAML frontmatter from per-project templates.
5
+
6
+ ## Quick Start
7
+
8
+ ```bash
9
+ pip install worklog-opsdevnz
10
+
11
+ # Create today's worklog
12
+ worklog-opsdevnz
13
+
14
+ # Show installed version
15
+ worklog-opsdevnz --version
16
+
17
+ # Override the editor for this run
18
+ worklog-opsdevnz --editor nvim
19
+ ```
20
+
21
+ ## Configuration
22
+
23
+ Each project gets a `worklog.toml` at its root:
24
+
25
+ ```toml
26
+ worklog_dir = "docs/worklog"
27
+ structure = "year" # "flat", "year", or "year-month"
28
+ author = "Your Name"
29
+ editor = "nvim" # optional, overridden by -e / $VISUAL / $EDITOR
30
+ default_tags = ["worklog", "log"]
31
+
32
+ [[sections]]
33
+ title = "Focus for Today"
34
+
35
+ [[sections]]
36
+ title = "Completed"
37
+
38
+ [[sections]]
39
+ title = "Notes"
40
+
41
+ [[sections]]
42
+ title = "Next"
43
+ ```
44
+
45
+ ## Features
46
+
47
+ - Per-project configuration via `worklog.toml`
48
+ - Three directory structure modes: `flat`, `year`, `year-month`
49
+ - YAML frontmatter: date, author, tags, draft status
50
+ - Configurable section headers per project
51
+ - Editor integration: `-e` flag → config → `$VISUAL` → `$EDITOR`
52
+ - `--version` flag for installed version
53
+
54
+ ## Requirements
55
+
56
+ - Python 3.12+
57
+ - See [pyproject.toml](pyproject.toml) for full dependencies
58
+
59
+ ## Documentation
60
+
61
+ - [Release Process](docs/release-process.md)
62
+ - [Functional Requirements](docs/specs/README.md)
63
+ - [Non-Functional Requirements](docs/specs/NFR.md)
64
+ - [Design Decisions](docs/design/README.md)
65
+ - [User Stories](docs/stories/README.md)
66
+
67
+ ## Related
68
+
69
+ - [PyPI](https://pypi.org/project/worklog-opsdevnz/)
70
+ - [GitHub](https://github.com/startmeup-nz/worklog_opsdevnz)
71
+ - [OpsDev.nz Collective](https://opsdev.nz)
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "worklog-opsdevnz"
7
- version = "0.1.0"
7
+ version = "0.1.1"
8
8
  description = "Configurable worklog management CLI for dated development logs"
9
9
  readme = "README.md"
10
10
  license = {text = "Apache-2.0"}
@@ -19,7 +19,7 @@ from worklog_opsdevnz.template import generate_content
19
19
  "-e",
20
20
  "--editor",
21
21
  default=None,
22
- help="Override the editor command (default: $VISUAL or $EDITOR).",
22
+ help="Override the editor command (overrides config, $VISUAL, $EDITOR).",
23
23
  )
24
24
  def main(editor: str | None) -> None:
25
25
  """Create or open today's worklog entry."""
@@ -36,12 +36,12 @@ def main(editor: str | None) -> None:
36
36
  target.write_text(content)
37
37
  print(f"Created: {target}")
38
38
 
39
- _open_editor(target, editor)
39
+ _open_editor(target, editor, config.get("editor"))
40
40
 
41
41
 
42
- def _open_editor(path: str | Path, override: str | None = None) -> None:
42
+ def _open_editor(path: str | Path, override: str | None = None, config_editor: str | None = None) -> None:
43
43
  """Open the file in the configured editor, or print the path."""
44
- editor = _resolve_editor(override)
44
+ editor = _resolve_editor(override, config_editor)
45
45
  if editor:
46
46
  editor_cmd = shutil.which(editor)
47
47
  if editor_cmd:
@@ -54,11 +54,11 @@ def _open_editor(path: str | Path, override: str | None = None) -> None:
54
54
  print(f"No editor configured. Path: {path}")
55
55
 
56
56
 
57
- def _resolve_editor(override: str | None = None) -> str | None:
58
- """Resolve editor from CLI override, $VISUAL, or $EDITOR."""
57
+ def _resolve_editor(override: str | None = None, config_editor: str | None = None) -> str | None:
58
+ """Resolve editor from CLI, config, $VISUAL, or $EDITOR."""
59
59
  import os
60
60
 
61
- for candidate in (override, os.environ.get("VISUAL"), os.environ.get("EDITOR")):
61
+ for candidate in (override, config_editor, os.environ.get("VISUAL"), os.environ.get("EDITOR")):
62
62
  if candidate:
63
63
  return candidate
64
64
  return None
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: worklog-opsdevnz
3
- Version: 0.1.0
3
+ Version: 0.1.1
4
4
  Summary: Configurable worklog management CLI for dated development logs
5
5
  Author-email: "OpsDev.nz Collective" <john@opsdev.nz>
6
6
  License: Apache-2.0
@@ -31,41 +31,21 @@ Requires-Dist: ruff>=0.4; extra == "dev"
31
31
  Requires-Dist: mypy>=1.0; extra == "dev"
32
32
  Dynamic: license-file
33
33
 
34
- # WorkLog OpsDev.NZ
35
-
36
- **Status:** Development — see pyproject.toml for version
34
+ # worklog-opsdevnz
37
35
 
38
36
  Configurable CLI tool for creating and managing dated development worklogs.
39
37
  Generates Markdown entries with YAML frontmatter from per-project templates.
40
38
 
41
- ## Problem
42
-
43
- Across multiple projects we kept reinventing the same pattern: a script that
44
- creates a dated Markdown file from a template, with frontmatter for date,
45
- author, tags, and draft status. Each implementation had slightly different
46
- directory structures, section headers, and filenames. The core concept was
47
- always the same.
48
-
49
- ## Solution
50
-
51
- `worklog-opsdevnz` formalises this pattern into a single published module:
52
-
53
- - **Per-project config** — `worklog.toml` controls directory structure, sections,
54
- author, tags, and filename patterns
55
- - **Three structure modes** — `flat`, `year`, or `year-month` directory layouts
56
- - **YAML frontmatter** — date, title, author, tags, draft status
57
- - **Configurable sections** — each project defines its own section headers
58
- - **Editor integration** — opens new entries in `$VISUAL` / `$EDITOR`
59
- - **List existing entries** — browse worklogs with `--list`
60
-
61
39
  ## Quick Start
62
40
 
63
41
  ```bash
42
+ pip install worklog-opsdevnz
43
+
64
44
  # Create today's worklog
65
45
  worklog-opsdevnz
66
46
 
67
- # Create yesterday's worklog
68
- worklog-opsdevnz --previous
47
+ # Show installed version
48
+ worklog-opsdevnz --version
69
49
 
70
50
  # Override the editor for this run
71
51
  worklog-opsdevnz --editor nvim
@@ -79,6 +59,7 @@ Each project gets a `worklog.toml` at its root:
79
59
  worklog_dir = "docs/worklog"
80
60
  structure = "year" # "flat", "year", or "year-month"
81
61
  author = "Your Name"
62
+ editor = "nvim" # optional, overridden by -e / $VISUAL / $EDITOR
82
63
  default_tags = ["worklog", "log"]
83
64
 
84
65
  [[sections]]
@@ -94,34 +75,30 @@ title = "Notes"
94
75
  title = "Next"
95
76
  ```
96
77
 
97
- ## Scope
78
+ ## Features
98
79
 
99
- **WorkLog DOES:**
100
- - Create dated Markdown worklog entries with YAML frontmatter
101
80
  - Per-project configuration via `worklog.toml`
102
- - Open entries in configured editor (`$VISUAL` / `$EDITOR`)
103
- - Three directory structure modes: flat, year, year-month
104
-
105
- **WorkLog DOES NOT (out of scope for 0.0.2):**
106
- - Zensical blog integration (see design doc)
107
- - Auto-generated index pages
108
- - Retro template support (planned for 0.1.0)
109
- - Time tracking / timesheet aggregation
110
- - `list`, `init`, or `create` subcommands (planned for 0.1.0)
81
+ - Three directory structure modes: `flat`, `year`, `year-month`
82
+ - YAML frontmatter: date, author, tags, draft status
83
+ - Configurable section headers per project
84
+ - Editor integration: `-e` flag config → `$VISUAL` → `$EDITOR`
85
+ - `--version` flag for installed version
111
86
 
112
87
  ## Requirements
113
88
 
114
89
  - Python 3.12+
115
90
  - See [pyproject.toml](pyproject.toml) for full dependencies
116
91
 
117
- ## Related
92
+ ## Documentation
118
93
 
94
+ - [Release Process](docs/release-process.md)
119
95
  - [Functional Requirements](docs/specs/README.md)
96
+ - [Non-Functional Requirements](docs/specs/NFR.md)
120
97
  - [Design Decisions](docs/design/README.md)
121
98
  - [User Stories](docs/stories/README.md)
122
99
 
123
- ---
100
+ ## Related
124
101
 
125
- **Last Updated:** 2026-05-23
126
- **Status:** Development (migrated to module template)
127
- **Maintainer:** OpsDev.nz Collective
102
+ - [PyPI](https://pypi.org/project/worklog-opsdevnz/)
103
+ - [GitHub](https://github.com/startmeup-nz/worklog_opsdevnz)
104
+ - [OpsDev.nz Collective](https://opsdev.nz)
@@ -47,3 +47,25 @@ def test_main_version():
47
47
  # Extract and verify it's a non-empty version string
48
48
  version_str = result.output.strip().split(", version ")[-1]
49
49
  assert version_str
50
+
51
+
52
+ def test_main_editor_from_config(tmp_path, monkeypatch):
53
+ """Editor in worklog.toml is resolved before $VISUAL/$EDITOR."""
54
+ monkeypatch.chdir(tmp_path)
55
+ (tmp_path / "worklog.toml").write_text('editor = "fake-editor-test"\n')
56
+ runner = CliRunner()
57
+ result = runner.invoke(main, [])
58
+ assert result.exit_code == 0
59
+ # config-based editor picked up but not found in PATH
60
+ assert "Editor 'fake-editor-test' not found" in result.output
61
+
62
+
63
+ def test_main_editor_cli_overrides_config(tmp_path, monkeypatch):
64
+ """-e flag overrides the editor set in worklog.toml."""
65
+ monkeypatch.chdir(tmp_path)
66
+ (tmp_path / "worklog.toml").write_text('editor = "fake-editor-test"\n')
67
+ runner = CliRunner()
68
+ result = runner.invoke(main, ["-e", "override-editor-test"])
69
+ assert result.exit_code == 0
70
+ # CLI override takes priority over config
71
+ assert "Editor 'override-editor-test' not found" in result.output
@@ -1,94 +0,0 @@
1
- # WorkLog OpsDev.NZ
2
-
3
- **Status:** Development — see pyproject.toml for version
4
-
5
- Configurable CLI tool for creating and managing dated development worklogs.
6
- Generates Markdown entries with YAML frontmatter from per-project templates.
7
-
8
- ## Problem
9
-
10
- Across multiple projects we kept reinventing the same pattern: a script that
11
- creates a dated Markdown file from a template, with frontmatter for date,
12
- author, tags, and draft status. Each implementation had slightly different
13
- directory structures, section headers, and filenames. The core concept was
14
- always the same.
15
-
16
- ## Solution
17
-
18
- `worklog-opsdevnz` formalises this pattern into a single published module:
19
-
20
- - **Per-project config** — `worklog.toml` controls directory structure, sections,
21
- author, tags, and filename patterns
22
- - **Three structure modes** — `flat`, `year`, or `year-month` directory layouts
23
- - **YAML frontmatter** — date, title, author, tags, draft status
24
- - **Configurable sections** — each project defines its own section headers
25
- - **Editor integration** — opens new entries in `$VISUAL` / `$EDITOR`
26
- - **List existing entries** — browse worklogs with `--list`
27
-
28
- ## Quick Start
29
-
30
- ```bash
31
- # Create today's worklog
32
- worklog-opsdevnz
33
-
34
- # Create yesterday's worklog
35
- worklog-opsdevnz --previous
36
-
37
- # Override the editor for this run
38
- worklog-opsdevnz --editor nvim
39
- ```
40
-
41
- ## Configuration
42
-
43
- Each project gets a `worklog.toml` at its root:
44
-
45
- ```toml
46
- worklog_dir = "docs/worklog"
47
- structure = "year" # "flat", "year", or "year-month"
48
- author = "Your Name"
49
- default_tags = ["worklog", "log"]
50
-
51
- [[sections]]
52
- title = "Focus for Today"
53
-
54
- [[sections]]
55
- title = "Completed"
56
-
57
- [[sections]]
58
- title = "Notes"
59
-
60
- [[sections]]
61
- title = "Next"
62
- ```
63
-
64
- ## Scope
65
-
66
- **WorkLog DOES:**
67
- - Create dated Markdown worklog entries with YAML frontmatter
68
- - Per-project configuration via `worklog.toml`
69
- - Open entries in configured editor (`$VISUAL` / `$EDITOR`)
70
- - Three directory structure modes: flat, year, year-month
71
-
72
- **WorkLog DOES NOT (out of scope for 0.0.2):**
73
- - Zensical blog integration (see design doc)
74
- - Auto-generated index pages
75
- - Retro template support (planned for 0.1.0)
76
- - Time tracking / timesheet aggregation
77
- - `list`, `init`, or `create` subcommands (planned for 0.1.0)
78
-
79
- ## Requirements
80
-
81
- - Python 3.12+
82
- - See [pyproject.toml](pyproject.toml) for full dependencies
83
-
84
- ## Related
85
-
86
- - [Functional Requirements](docs/specs/README.md)
87
- - [Design Decisions](docs/design/README.md)
88
- - [User Stories](docs/stories/README.md)
89
-
90
- ---
91
-
92
- **Last Updated:** 2026-05-23
93
- **Status:** Development (migrated to module template)
94
- **Maintainer:** OpsDev.nz Collective