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
172 downloads per month
Used in 6 crates
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