feat: expense tracker Python parity (Wave 10)
New `expenses_handlers.py`: - parse_expense(phrase) -> (amount, category) | None — pure fn, fully unit-tested. Handles "потратил 500 на еду", comma decimals "12,50", EN "spent 12.5 on coffee", default category "разное". - do_expenses_log: append entry to expenses.json (atomic write-then-rename). - do_expenses_today: sum today's entries (local-day boundary). - do_expenses_week: rolling 7-day total + count. - do_expenses_breakdown: per-category, top-5 + tail collapse. extensions.py / main.py / commands.yaml: 4 new dispatch entries. .gitignore: + expenses.json. tests/test_expenses_handlers.py: 8 unit tests covering parse, log, today/week math, breakdown ordering + tail collapse. Tests: 96 → 104 (+8). Total Python coverage now mirrors Rust pack behaviour for personal finance.
This commit is contained in:
parent
b3cfaa5171
commit
f102b8dc95
6 changed files with 343 additions and 0 deletions
1
.gitignore
vendored
1
.gitignore
vendored
|
|
@ -17,6 +17,7 @@ llm_backend.txt
|
|||
llm_history.json
|
||||
active_profile.txt
|
||||
time_tracker.json
|
||||
expenses.json
|
||||
|
||||
# C extensions
|
||||
*.so
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue