Add --weekly flag to csv command

- Add `write_csv_weekly()` to output.py: writes entries from multiple
  days as a single CSV with one header row, correct date per row
- Add `-w`/`--weekly` flag to csv subparser
- _cmd_csv branches on args.weekly: fetches week sections, formats
  per-day date strings, calls write_csv_weekly; --raw is honoured
- Add TestWriteCsvWeekly with 6 tests
- Update README with weekly csv usage examples
This commit is contained in:
Jef Roosens 2026-05-28 13:14:43 +02:00
parent 985ee28113
commit cd8ca789aa
Signed by: Jef Roosens
GPG key ID: 119385BCAA005C21
4 changed files with 134 additions and 10 deletions

View file

@ -67,6 +67,8 @@ uv run timesheets summary -w -ss --joplin # weekly totals only: one line
uv run timesheets csv --joplin # stdout
uv run timesheets csv --joplin -o output.csv # write to file
uv run timesheets csv --raw --joplin # one row per entry, no aggregation
uv run timesheets csv -w --joplin # full week
uv run timesheets csv -w --raw --joplin # full week, no aggregation
```
### stories