Skip to main content

Crate acc

Crate acc 

Source
Expand description

Pipeline:

load:    parser → resolver → booker → indexer ─────────────────────► Journal
enrich:  expander → realizer → lotter → translator → revaluator      (journal-global)
report:  filter → rebalancer → sorter → commands                     (CLI-driven)

load builds a validated Journal. pipeline::enrich runs the journal-global phases that must see every transaction (realizer and translator only under -X; the revaluator only under -X with --unrealized; lotter needs capital accounts). The report phases are driven by CLI flags and run last, per command.

Re-exports§

pub use error::Error;
pub use loader::load;
pub use loader::Journal;
pub use loader::LoadError;

Modules§

booker
Booker phase — the only phase with cross-transaction state.
commands
User-facing commands. Each command lives in its own folder; the folder name matches the clap subcommand name.
date
Date — calendar date as days-since-1970, UTC, no time-of-day.
decimal
Strict fixed-point decimal: mantissa × 10^(-MAX_SCALE) always.
error
Central error type and source-excerpt rendering.
expander
Expander phase — apply automated-transaction rules.
filter
Transaction filter.
indexer
Indexer phase.
loader
Loader phase.
lotter
Lotter phase — realized capital gains via FIFO lot tracking.
parser
Journal parser.
pipeline
Pipeline orchestration — the journal-global enrichment phases that run after load and before any filtering, conversion or sorting.
realizer
Realizer phase — inject FX gain/loss postings.
rebalancer
Rebalance phase — convert every posting’s amount into a target commodity using the journal’s PriceDB.
resolver
Resolve phase.
revaluator
Revaluator phase — mark-to-market revaluation of open positions.
sorter
Sort phase — reorder transactions for report display.
translator
Translator phase — book Currency Translation Adjustment (CTA).

Constants§

JOURNAL_EXTENSIONS
Extension treated as a journal file when walking a directory. Only .ledger is picked up by the recursive walk, so non-journal files that happen to live in the tree (.txt meter readings, notes, data dumps) are left alone. Explicit -f FILE arguments bypass this filter entirely — when the user names a path directly, acc reads it whatever the extension.

Functions§

is_journal_file
True if path has the recognised journal extension. Used by directory walkers; never used to reject explicit -f paths.