Expand description
Import framework for rustledger
This crate provides the infrastructure for extracting transactions from bank statements, credit card statements, and other financial documents.
§Overview
The import system is modeled after Python beancount’s bean-extract. It uses
a trait-based approach where each importer implements the Importer trait.
§Example
use rustledger_importer::{ImporterConfig, ImporterRegistry};
use std::path::Path;
// Build the per-call config (CSV in this example).
let config = ImporterConfig::csv()
.account("Assets:Bank:Checking")
.date_column("Date")
.narration_column("Description")
.amount_column("Amount")
.build()
.unwrap();
// Dispatch through the registry — picks OfxImporter for .ofx/.qfx,
// CsvImporter for .csv. Returns an error for unknown extensions.
let registry = ImporterRegistry::with_builtins();
// let result = registry.extract(Path::new("bank.csv"), &config)?;Re-exports§
pub use config::ImporterConfig;pub use ofx_importer::OfxImporter;pub use registry::ImporterRegistry;pub use registry::WasmDirScanReport;pub use wasm::WasmImporter;pub use wasm::WasmImporterError;pub use wasm::WasmRuntimeConfig;
Modules§
- config
- Configuration for importers.
- csv_
importer - CSV file importer.
- csv_
inference - CSV format auto-inference.
- ofx_
importer - OFX/QFX file importer.
- registry
- Registry for importers.
- wasm
- Host loader for WASM-implemented importers (wave 2.3b).
Structs§
- Enriched
Import Result - Result of an enriched import operation.
- Import
Result - Result of an import operation.
Traits§
- Importer
- Trait for file importers.
Functions§
- auto_
extract - Auto-extract transactions from a file by inferring its format.