- ExcelRepository: canonical columns with ru/en aliases, date/number normalization (Excel dates, DD.MM.YYYY, '1 234,56', currency symbols, parentheses), account name->UUID resolution, per-row errors with sheet!row, warnings for formulas without cached values, duplicate names and default exchange rates - ExcelTemplate: skeleton generator (number/date formats, dropdowns for currency, frequency en/ru and account, 'Инструкция' sheet); ship data/model_template.xlsx - CLI: cf template-xlsx [--force]; cf import-xlsx --dry-run with rich error table, import writes nothing when the file has errors - RecurringCashflow.account (empty = all accounts) + name/UUID matching in forecast; cf config recurring-add --account, account column in info/recurring-list - Forecast: runs are idempotent, 'Итог: Баланс' sums all accounts of the last month - README: 'Сборка модели в Excel' section - ruff check . clean (9 pre-existing import/line-length findings fixed) - MetaAgent: T9 archived, req-T9 approved, manifest/checkpoints/state synced 118 tests pass
48 lines
1.1 KiB
Python
48 lines
1.1 KiB
Python
"""Entry point приложения cf. Регистрирует все команды."""
|
|
import sys
|
|
|
|
import typer
|
|
|
|
try:
|
|
sys.stdout.reconfigure(encoding="utf-8")
|
|
except (AttributeError, OSError):
|
|
pass
|
|
|
|
from infrastructure.cli.commands import (
|
|
analyze,
|
|
compare,
|
|
config_cmd,
|
|
export_xlsx,
|
|
forecast,
|
|
import_xlsx,
|
|
info,
|
|
init,
|
|
scenario,
|
|
template_xlsx,
|
|
whatif,
|
|
)
|
|
from infrastructure.cli.i18n import setup_i18n, t
|
|
|
|
setup_i18n()
|
|
|
|
app = typer.Typer(name="cf", help=t("app.help"))
|
|
|
|
# Команды верхнего уровня
|
|
app.command(name="init")(init.init)
|
|
app.command(name="forecast")(forecast.forecast)
|
|
app.command(name="scenario")(scenario.scenario)
|
|
app.command(name="whatif")(whatif.whatif)
|
|
app.command(name="compare")(compare.compare)
|
|
app.command(name="template-xlsx")(template_xlsx.template_xlsx)
|
|
app.command(name="import-xlsx")(import_xlsx.import_xlsx)
|
|
app.command(name="export-xlsx")(export_xlsx.export_xlsx)
|
|
app.command(name="analyze")(analyze.analyze)
|
|
app.command(name="info")(info.info)
|
|
|
|
# Под-приложение config
|
|
app.add_typer(config_cmd.app, name="config")
|
|
|
|
|
|
if __name__ == "__main__":
|
|
app()
|