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

rustledger-booking

Beancount booking engine with 7 lot matching methods and interpolation

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

#688 in Finance

Download history 59/week @ 2026-01-14 103/week @ 2026-01-21 62/week @ 2026-01-28 25/week @ 2026-02-04 92/week @ 2026-02-11 62/week @ 2026-02-18 72/week @ 2026-02-25 57/week @ 2026-03-04 18/week @ 2026-03-11 34/week @ 2026-03-18 60/week @ 2026-03-25 53/week @ 2026-04-01

172 downloads per month
Used in 6 crates

GPL-3.0-only

460KB
9K SLoC

rustledger-booking

Beancount booking engine with 7 lot matching methods and amount interpolation.

Booking Methods

Method Description
STRICT Lots must match exactly (default)
STRICT_WITH_SIZE Exact-size matches accept oldest lot
FIFO First in, first out
LIFO Last in, first out
HIFO Highest cost first
AVERAGE Average cost basis
NONE No cost tracking

Features

  • Amount interpolation for incomplete postings
  • Cost basis calculation
  • Lot matching with configurable strategies
  • Transaction balancing

Example

use rustledger_booking::{BookingEngine, BookingMethod};

// Using the booking engine for a single transaction
let mut engine = BookingEngine::with_method(BookingMethod::Fifo);
let result = engine.book_and_interpolate(&transaction)?;

// Using the batch function for multiple transactions
use rustledger_booking::book_transactions;
let results = book_transactions(&transactions, BookingMethod::Fifo);
for result in results {
    match result {
        Ok(booked) => { /* handle successfully booked transaction */ }
        Err(err) => { /* handle booking error */ }
    }
}

License

GPL-3.0

Dependencies

~5.5MB
~116K SLoC