pyworklog 0.3.0__py3-none-any.whl
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.
- pyworklog-0.3.0.dist-info/METADATA +136 -0
- pyworklog-0.3.0.dist-info/RECORD +20 -0
- pyworklog-0.3.0.dist-info/WHEEL +4 -0
- pyworklog-0.3.0.dist-info/entry_points.txt +2 -0
- pyworklog-0.3.0.dist-info/licenses/LICENSE +21 -0
- worklog/__init__.py +8 -0
- worklog/cli.py +1160 -0
- worklog/commands/__init__.py +89 -0
- worklog/commands/bulk.py +512 -0
- worklog/commands/meta.py +579 -0
- worklog/commands/query.py +854 -0
- worklog/commands/state.py +651 -0
- worklog/commands/views.py +558 -0
- worklog/completion.py +624 -0
- worklog/db.py +92 -0
- worklog/helpers.py +288 -0
- worklog/migrations/0001_initial_schema.sql +90 -0
- worklog/queries.py +216 -0
- worklog/render.py +209 -0
- worklog/xdg.py +42 -0
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: pyworklog
|
|
3
|
+
Version: 0.3.0
|
|
4
|
+
Summary: SQLite-backed worklog tool with a todo.sh-style CLI
|
|
5
|
+
Project-URL: Homepage, https://github.com/xyb/worklog
|
|
6
|
+
Project-URL: Repository, https://github.com/xyb/worklog
|
|
7
|
+
Project-URL: Issues, https://github.com/xyb/worklog/issues
|
|
8
|
+
Author: Xie Yanbo
|
|
9
|
+
License-Expression: MIT
|
|
10
|
+
License-File: LICENSE
|
|
11
|
+
Keywords: cli,productivity,sqlite,todo,worklog
|
|
12
|
+
Classifier: Development Status :: 4 - Beta
|
|
13
|
+
Classifier: Environment :: Console
|
|
14
|
+
Classifier: Intended Audience :: Developers
|
|
15
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
16
|
+
Classifier: Operating System :: MacOS
|
|
17
|
+
Classifier: Operating System :: POSIX :: Linux
|
|
18
|
+
Classifier: Programming Language :: Python :: 3
|
|
19
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
20
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
21
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
22
|
+
Classifier: Topic :: Office/Business
|
|
23
|
+
Classifier: Topic :: Utilities
|
|
24
|
+
Requires-Python: >=3.11
|
|
25
|
+
Requires-Dist: rich>=13
|
|
26
|
+
Description-Content-Type: text/markdown
|
|
27
|
+
|
|
28
|
+
<sub><b>🌐 English</b> · <a href="README.zh.md">中文</a></sub>
|
|
29
|
+
|
|
30
|
+
# worklog
|
|
31
|
+
|
|
32
|
+
[](https://github.com/xyb/worklog/actions/workflows/test.yml)
|
|
33
|
+
[](https://codecov.io/gh/xyb/worklog)
|
|
34
|
+
|
|
35
|
+
> **Changelog**: see [CHANGELOG.md](CHANGELOG.md) for a curated highlight reel of every release.
|
|
36
|
+
|
|
37
|
+
SQLite-backed worklog tool with a `todo.sh`-style CLI. Models the full execution-system hierarchy in a single `node` table — lifetime / decade / year / quarter / month / week / day / project / task / habit / signal / meetlog — all sharing one id space, tree-linked via `parent_id` self-reference.
|
|
38
|
+
|
|
39
|
+
**Design conventions: see [DESIGN.md](DESIGN.md)** — required reading before adding commands, to keep everything consistent.
|
|
40
|
+
**AI collaboration: see [skills/worklog-cli/SKILL.md](skills/worklog-cli/SKILL.md)** — Claude Code skill (when / how to use `wl`, plus bulk import / apply).
|
|
41
|
+
Background: structured worklog tool, built as a self-built alternative after surveying 12 candidate products (Logseq / Tana / TaskWarrior / org-mode / Anytype / Capacities / Linear etc.) and finding no off-the-shelf tool that fits all three dimensions (time hierarchy, project hierarchy, vault wikilink) without compromise.
|
|
42
|
+
|
|
43
|
+
## Install
|
|
44
|
+
|
|
45
|
+
### From PyPI (recommended for users)
|
|
46
|
+
|
|
47
|
+
```fish
|
|
48
|
+
pipx install pyworklog # or: uv tool install pyworklog
|
|
49
|
+
wl init
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
The PyPI distribution name is `pyworklog` (the short names `worklog` and `worklog-cli` were already taken, and hyphenated names like `worklog-py` were avoided); the command stays `wl` and the import name stays `worklog`.
|
|
53
|
+
|
|
54
|
+
### From source (recommended for development)
|
|
55
|
+
|
|
56
|
+
Requires [uv](https://docs.astral.sh/uv/) (`brew install uv` or `pipx install uv`).
|
|
57
|
+
|
|
58
|
+
```fish
|
|
59
|
+
git clone https://github.com/xyb/worklog.git ~/projects/worklog
|
|
60
|
+
cd ~/projects/worklog
|
|
61
|
+
make setup # uv sync + install ~/bin/wl wrapper
|
|
62
|
+
|
|
63
|
+
# shell completion (init-load mode, pick your shell)
|
|
64
|
+
# fish: add to ~/.config/fish/config.fish
|
|
65
|
+
echo 'wl print-completion fish | source' >> ~/.config/fish/config.fish
|
|
66
|
+
# bash: add to ~/.bashrc → eval "$(wl print-completion bash)"
|
|
67
|
+
# zsh: add to ~/.zshrc → eval "$(wl print-completion zsh)"
|
|
68
|
+
|
|
69
|
+
wl init
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
Behind the scenes `make setup` runs `uv sync` to create `.venv/` from `pyproject.toml` + `uv.lock`, then installs a `~/bin/wl` wrapper pointing into that `.venv`.
|
|
73
|
+
|
|
74
|
+
DB location follows the [XDG Base Directory spec](https://specifications.freedesktop.org/basedir-spec/): default `$XDG_DATA_HOME/worklog/worklog.db` (i.e. `~/.local/share/worklog/worklog.db`). Override per-invocation with `wl --db PATH ...`, or globally with the `$WORKLOG_DB` env var. User config (aliases.ini) lives at `$XDG_CONFIG_HOME/worklog/aliases.ini` (default `~/.config/worklog/aliases.ini`).
|
|
75
|
+
|
|
76
|
+
## Commands
|
|
77
|
+
|
|
78
|
+
```fish
|
|
79
|
+
wl add "research X" -k task -p A -t work,P0 --proj dev_tooling --parent 42
|
|
80
|
+
wl add "Dev tooling" -k project -p A --parent 4 # project hangs under month
|
|
81
|
+
wl log 42 "reviewed A's material, found..."
|
|
82
|
+
wl done 42
|
|
83
|
+
wl defer 42 2026-06-01
|
|
84
|
+
wl start 42 ; wl stop 42 # CLOCK in/out
|
|
85
|
+
wl link 42 "Dev tooling" # vault wikilink
|
|
86
|
+
wl set 42 owner xyb # custom prop
|
|
87
|
+
wl show 42 # detail + log + tags + links
|
|
88
|
+
wl ls # default: list open items
|
|
89
|
+
wl ls --kind project --tag work,P0
|
|
90
|
+
wl tree # full tree
|
|
91
|
+
wl tree --kind year --depth 3
|
|
92
|
+
wl logs --since 2026-05-18 # cross-task log range query
|
|
93
|
+
wl find needle # full-text search, matches highlighted + indented
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
### Highlighting / colors
|
|
97
|
+
|
|
98
|
+
Terminal output is colored by default (via `rich`); global flags go before the subcommand:
|
|
99
|
+
|
|
100
|
+
```fish
|
|
101
|
+
wl themes # list dark/light/mono themes + previews + mark current
|
|
102
|
+
wl --color always tree | less -R # force color (preserves ANSI through pipes)
|
|
103
|
+
wl --color never ls # no color (plain text)
|
|
104
|
+
wl --theme light summary --week ... # manually pick the light-background theme
|
|
105
|
+
```
|
|
106
|
+
|
|
107
|
+
- `--color {auto,always,never}`, default `auto`: colors on if TTY + rich available; pipes / redirects / no-rich downgrade to plain text
|
|
108
|
+
- `--theme {auto,dark,light,mono}`, default **auto**: probes terminal background and picks dark (dark bg) / light (light bg); falls back to dark when undetectable. dark/light/mono can also be picked manually.
|
|
109
|
+
- Background probe: first checks `$COLORFGBG`, then sends an OSC 11 query (needs an interactive terminal, short timeout, gracefully falls back if unsupported)
|
|
110
|
+
- Search hits (including matches in titles) highlight: styled mode uses background color; plain text wraps with `*…*`
|
|
111
|
+
- env fallback: `$WORKLOG_COLOR` / `$WORKLOG_THEME` / `$NO_COLOR`
|
|
112
|
+
- `rich` is an optional dependency — the tool still runs without it (plain text only)
|
|
113
|
+
|
|
114
|
+
## Schema
|
|
115
|
+
|
|
116
|
+
Six tables; everything is a `node`.
|
|
117
|
+
|
|
118
|
+
```
|
|
119
|
+
node (id, parent_id→node, title, kind, status, priority,
|
|
120
|
+
created_at, scheduled_at, deadline_at, closed_at, body)
|
|
121
|
+
tag (node_id→node, tag) # many-to-many
|
|
122
|
+
log (id, node_id→node, logged_at, body) # one node, many log entries
|
|
123
|
+
prop (node_id→node, key, value) # UDA
|
|
124
|
+
link (node_id→node, vault_doc) # vault wikilink
|
|
125
|
+
v_node_path # recursive CTE view, tree path
|
|
126
|
+
```
|
|
127
|
+
|
|
128
|
+
The `kind` field lets one table hold any execution-system entity. Cascade delete propagates to `tag/log/prop/link`; `parent_id` uses `ON DELETE SET NULL` so deleting a parent doesn't orphan-kill children.
|
|
129
|
+
|
|
130
|
+
## Status states
|
|
131
|
+
|
|
132
|
+
`TODO / DOING / LATER / WAIT / DONE / DEFERRED / CANCELED` — superset of the markdown `[ ]/[x]/[/]/[>]` four-state set, adds `LATER` / `WAIT` distinction (deferred to future vs. waiting on someone).
|
|
133
|
+
|
|
134
|
+
## Contributing
|
|
135
|
+
|
|
136
|
+
Development setup, the TDD/DRY conventions, local Makefile overrides, and the release process all live in [CONTRIBUTING.md](CONTRIBUTING.md). For agent-facing operating rules see [AGENTS.md](AGENTS.md); for canonical design conventions see [DESIGN.md](DESIGN.md).
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
worklog/__init__.py,sha256=4ICaqcHAxO1wPjM9HVb6ttTaHTcn04aFZXefMLg6E5U,247
|
|
2
|
+
worklog/cli.py,sha256=ab8wNTziONT-zzTd-mDalp06kkStt6N3rwFWyzBS3FU,58266
|
|
3
|
+
worklog/completion.py,sha256=QaBeVzxtV6IBwEtls2VdF9goZQPYdQZyA2bKwpXPNss,24819
|
|
4
|
+
worklog/db.py,sha256=fGg-h13VGXM0rSwTSsmT_4GZxxaxy_E2-XgZWPcWF3o,3417
|
|
5
|
+
worklog/helpers.py,sha256=klxqMHootwhSwClovEk4kjFaaml21t-havTp1iel3pQ,10792
|
|
6
|
+
worklog/queries.py,sha256=yvnQ-q6q8D7EtCqP4nv2OyYWb_GctaN62hsmKMtGXW8,8949
|
|
7
|
+
worklog/render.py,sha256=ie6I1RtOotsaYPnXpwLp5wzr4OvxKuOnfpnvH92E7ic,8775
|
|
8
|
+
worklog/xdg.py,sha256=nNth78n274F5GjpTbZYZa-Q5x_jIf2So0ZpqtgIfMvU,1424
|
|
9
|
+
worklog/commands/__init__.py,sha256=J7Pbhe-4sPbpq68pIaU08TQCKCigdMt51RKZDSkBqPQ,1750
|
|
10
|
+
worklog/commands/bulk.py,sha256=M2gWISXC3btSGItdEK1kut-48YZ06OssT82KGMR0a98,20962
|
|
11
|
+
worklog/commands/meta.py,sha256=3nxAVZWAoQm0egZNZzFt3ofg_intWO2cMH4Xu8NKREU,24116
|
|
12
|
+
worklog/commands/query.py,sha256=YmextEfM6dfh3OwILqYnfaXmkSH5r9uX7nhOkIX1nEs,36494
|
|
13
|
+
worklog/commands/state.py,sha256=u9v4mYPM71oWrBrLzA37fQNi_aGqjohErbT4WWAJNY8,26235
|
|
14
|
+
worklog/commands/views.py,sha256=0O-rNey3y6-5su0uvVsZLjau6AYhjzmUfwpGJuz5gnc,24668
|
|
15
|
+
worklog/migrations/0001_initial_schema.sql,sha256=bsHyhRdTA4xhpMhI7NlSs6QXWOraflQjEHKEiorky2Y,4107
|
|
16
|
+
pyworklog-0.3.0.dist-info/METADATA,sha256=zmN0R6_uihdNy6c_LmNK9tSs6NHhrhaSszuNfvBKvTA,7247
|
|
17
|
+
pyworklog-0.3.0.dist-info/WHEEL,sha256=QccIxa26bgl1E6uMy58deGWi-0aeIkkangHcxk2kWfw,87
|
|
18
|
+
pyworklog-0.3.0.dist-info/entry_points.txt,sha256=8fLnAvKY2dWuKkOENDr18v9KmWXpyR3Pbne839YaRh8,40
|
|
19
|
+
pyworklog-0.3.0.dist-info/licenses/LICENSE,sha256=YQPkgwT6XnCSanK6orDJXISLrE12O3MxulsDivd4ELg,1066
|
|
20
|
+
pyworklog-0.3.0.dist-info/RECORD,,
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Xie Yanbo
|
|
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.
|
worklog/__init__.py
ADDED