Add ~ marker to exclude entries from CSV export

Prefix the project name or note column with ~ to mark an entry as
count-but-don't-export. Marked entries are included in summary and
status totals but omitted from all csv output (both --raw and
aggregated, single-day and weekly).

  | 09:00 | 17:00 | 8:00 | ~Leave |  | Day off  |
  | 09:00 | 17:00 | 8:00 |  Leave |  | ~Day off |

The ~ is stripped from whichever field carries it before any
downstream processing, so project map resolution is unaffected.

Implementation:
- parse_table sets skip_csv=True on marked rows and strips the ~
- new filter_skip_csv() helper in parser.py
- to_csv_entries() skips skip_csv rows
- _cmd_csv calls filter_skip_csv() before aggregate_rows()
This commit is contained in:
Jef Roosens 2026-05-28 13:37:44 +02:00
parent 8b6f0b24e2
commit de46399010
Signed by: Jef Roosens
GPG key ID: 119385BCAA005C21
6 changed files with 209 additions and 25 deletions

View file

@ -85,6 +85,30 @@ uv run timesheets stories -w --joplin -o stories.md # write to file
uv run timesheets status --joplin
```
## Timesheet table format
Each day's entries live in a markdown pipe table with the following columns:
```markdown
| Start | End | Duration | Project | Story | Note |
|-------|-------|----------|---------|-----------|------------|
| 09:00 | 10:00 | 1:00 | acme | PROJ-123 | Fix bug |
| 10:00 | 10:15 | 0:15 | scrum | | dsu |
```
### Excluding entries from CSV export
Prefix the project name with `~` to mark an entry as **count-but-don't-export**.
The entry is included in `summary` and `status` totals, but omitted from `csv` output.
This is useful for time that is already pre-entered in Odoo (e.g. holidays, days off).
```markdown
| 09:00 | 17:00 | 8:00 | ~Leave | | Public holiday |
```
The `~` is stripped before project name resolution, so `~Leave` maps to the same
project as `Leave` in your `project_map.json`.
## Config file
Copy `timesheets.example.toml` to `timesheets.toml` in the working directory