CLI

Command-line interface provided by the finamt entry-point.

finamt --help

finamt.cli

Command-line interface for finamt.

Entry point registered in pyproject.toml:

[project.scripts]
finamt = "finamt.cli:main"

Usage examples

finamt –version

# Single receipt finamt process receipt1 –input-dir receipts/

# Batch finamt batch –input-dir receipts/ –output-dir results/

# Scan receipts into local DB, then generate Q1 UStVA report finamt ustva –input-dir receipts/ –quarter 1 –year 2024

# Generate report from already-stored receipts finamt ustva –quarter 1 –year 2024 –output ustva_q1.json

# Use a custom DB path finamt ustva –input-dir receipts/ –db /tmp/mydb.db

# Start the web UI finamt serve –port 8000

class finamt.cli.FinamtCLI[source]

Bases: object

print_version() None[source]
process_receipt(file_stem: str, input_dir: str | Path, output_dir: str | Path | None = None, verbose: bool = False, receipt_type: str = 'purchase', db_path: Path | None = None, no_db: bool = False) int[source]

Process one receipt PDF. DB save is automatic. Returns exit code.

batch_process(input_dir: str | Path, output_dir: str | Path | None = None, verbose: bool = False, receipt_type: str = 'purchase', db_path: Path | None = None, no_db: bool = False) int[source]

Batch-process all PDFs. DB save is automatic. Returns exit code.

ingest_receipts(input_dir: Path, db_path: Path | None = None, verbose: bool = False, receipt_type: str = 'purchase') int[source]

Scan PDFs and auto-save to DB. Returns number saved.

run_ustva(quarter: int, year: int, db_path: Path | None = None, output: Path | None = None, output_dir: Path | None = None) int[source]

Generate and print a UStVA report for the given quarter.

Parameters:
  • output – Explicit output file path. Takes priority over output_dir.

  • output_dir – Directory to write an auto-named file (e.g. ustva_q1_2024.json).

finamt.cli.callback(ctx: Context, version: Annotated[bool, <typer.models.OptionInfo object at 0x7fd05a40e060>]=False) None[source]

finamt: process German receipts and prepare German tax returns.

finamt.cli.cmd_process(file: ~typing.Annotated[str, <typer.models.ArgumentInfo object at 0x7fd05a4154f0>], input_dir: ~typing.Annotated[~pathlib.Path, <typer.models.OptionInfo object at 0x7fd05a415220>], output_dir: ~typing.Annotated[~pathlib.Path | None, <typer.models.OptionInfo object at 0x7fd05a4167e0>] = None, verbose: ~typing.Annotated[bool, <typer.models.OptionInfo object at 0x7fd05c142c00>] = False, receipt_type: ~typing.Annotated[str, <typer.models.OptionInfo object at 0x7fd05beb3680>] = 'purchase', db: ~typing.Annotated[~pathlib.Path | None, <typer.models.OptionInfo object at 0x7fd05becec00>] = None, no_db: ~typing.Annotated[bool, <typer.models.OptionInfo object at 0x7fd05a414710>] = False) None[source]

Process a single receipt PDF and extract its data.

finamt.cli.cmd_batch(input_dir: ~typing.Annotated[~pathlib.Path, <typer.models.OptionInfo object at 0x7fd05a40f920>], output_dir: ~typing.Annotated[~pathlib.Path | None, <typer.models.OptionInfo object at 0x7fd05a40d4f0>] = None, verbose: ~typing.Annotated[bool, <typer.models.OptionInfo object at 0x7fd05c142c00>] = False, receipt_type: ~typing.Annotated[str, <typer.models.OptionInfo object at 0x7fd05beb3680>] = 'purchase', db: ~typing.Annotated[~pathlib.Path | None, <typer.models.OptionInfo object at 0x7fd05becec00>] = None, no_db: ~typing.Annotated[bool, <typer.models.OptionInfo object at 0x7fd05a40ecc0>] = False) None[source]

Batch-process all PDFs in a directory.

finamt.cli.cmd_ustva(quarter: Annotated[int, <typer.models.OptionInfo object at 0x7fd05bf45160>]=1, year: Annotated[int, <typer.models.OptionInfo object at 0x7fd05becc050>]=2026, input_dir: Path | None, <typer.models.OptionInfo object at 0x7fd05a40faa0>]=None, output: Path | None, <typer.models.OptionInfo object at 0x7fd05a4149e0>]=None, output_dir: Path | None, <typer.models.OptionInfo object at 0x7fd05a417530>]=None, verbose: Annotated[bool, <typer.models.OptionInfo object at 0x7fd05c142c00>]=False, receipt_type: Annotated[str, <typer.models.OptionInfo object at 0x7fd05beb3680>]='purchase', db: Path | None, <typer.models.OptionInfo object at 0x7fd05becec00>]=None) None[source]

Generate a UStVA (VAT pre-return) report for a fiscal quarter.

finamt.cli.cmd_serve(host: Annotated[str, <typer.models.OptionInfo object at 0x7fd05a414560>]='127.0.0.1', port: Annotated[int, <typer.models.OptionInfo object at 0x7fd05a414980>]=8000, no_browser: Annotated[bool, <typer.models.OptionInfo object at 0x7fd05a414dd0>]=False, reload: Annotated[bool, <typer.models.OptionInfo object at 0x7fd05a414e90>]=False, log_level: Annotated[str, <typer.models.OptionInfo object at 0x7fd05a415100>]='warning') None[source]

Start the finamt web UI server.

finamt.cli.main() None[source]