#finance-ledger #ledger #beancount #double-entry #accounting

rustledger-loader

Beancount file loader with include resolution and options parsing

24 releases (9 breaking)

Uses new Rust 2024

new 0.11.0 Apr 3, 2026
0.10.1 Mar 13, 2026
0.9.1 Feb 18, 2026

#9 in #double-entry

Download history 62/week @ 2026-01-15 104/week @ 2026-01-22 54/week @ 2026-01-29 22/week @ 2026-02-05 93/week @ 2026-02-12 56/week @ 2026-02-19 63/week @ 2026-02-26 50/week @ 2026-03-05 12/week @ 2026-03-12 29/week @ 2026-03-19 58/week @ 2026-03-26

154 downloads per month
Used in 4 crates (3 directly)

GPL-3.0-only

1MB
17K SLoC

Beancount file loader with include resolution.

This crate handles loading beancount files, resolving includes, and collecting options. It builds on the parser to provide a complete loading pipeline.

Features

  • Recursive include resolution with cycle detection
  • Options collection and parsing
  • Plugin directive collection
  • Source map for error reporting
  • Push/pop tag and metadata handling
  • Automatic GPG decryption for encrypted files (.gpg, .asc)

Example

use rustledger_loader::Loader;
use std::path::Path;

let result = Loader::new().load(Path::new("ledger.beancount"))?;
for directive in result.directives {
    println!("{:?}", directive);
}

rustledger-loader

Beancount file loader with include resolution, options parsing, and binary caching.

Features

  • Recursive include directive resolution
  • Option parsing and validation
  • Plugin directive collection
  • Binary cache for faster subsequent loads
  • Path traversal protection

Example

use rustledger_loader::{Loader, LoadOptions};
use std::path::Path;

// Simple loading (raw parse without processing)
let result = Loader::new().load(Path::new("ledger.beancount"))?;
println!("Loaded {} directives", result.directives.len());

// With full processing (booking, plugins, validation)
use rustledger_loader::load;
let ledger = load(Path::new("ledger.beancount"), &LoadOptions::default())?;
println!("Processed {} directives", ledger.directives.len());

Cargo Features

  • cache (default) - Enable rkyv-based binary caching for faster loads

License

GPL-3.0

Dependencies

~10–34MB
~551K SLoC