Reference

ledger-cli

class ledgercli.main.Ledger(output_dir: Path, bank: str | None)[source]

Ledger.

init_history() None[source]

Creates history dataframe.

All transactions (TX) are grouped by date and a cumulative sum is calculated while taking starting_balance into account. history gets rewritten everytime it’s generated and based on TX as there is no way to generate a valid cumulative sum after coalescing or distributing.

init_metadata(export_path: Path) None[source]

Initialize metadata from export.

Parameters:

export_path – path to export

init_tx(export_path: Path) None[source]

Add export to transactions.

Parameters:

export_path – path to export

init_tx_c() None[source]

Coalesces all custom values.

init_tx_d() None[source]

Distributes coalesced transactions based on occurence.

update(export_path: Optional[Path] = None) None[source]

Wrapper for updating the Ledger.

Parameters:

export_path – path to export

update_mapping() None[source]

Adds new transaction recipients to mapping table.

Takes all recipients from transactions, removes recipients already featured in mapping table and appends them to current mapping table. Sorts mapping table after.

update_tx_mapping() None[source]

Updates mappings in transactions with current mapping table.

write() None[source]

Writes all tables to output_dir.