rustledger-importer
Import framework for rustledger - extract transactions from bank files.
Overview
This crate provides infrastructure for extracting Beancount transactions from bank statements, credit card statements, and other financial documents. It follows the design of Python beancount's bean-extract.
Supported Formats
| Format | Description |
|---|---|
| CSV | Configurable CSV importer with column mapping |
| OFX/QFX | Open Financial Exchange format |
Example
use ;
use Path;
// Create a CSV importer configuration
let config = csv
.account
.currency
.date_column
.narration_column
.amount_column
.build;
// Extract transactions from a file
let result = extract_from_file?;
for directive in result.directives
Enriched Imports
The enrichment pipeline adds intelligence on top of basic CSV/OFX extraction:
- Auto-inference of CSV format (delimiter, date format, column roles)
- Merchant dictionary for automatic account categorization
- Fingerprinting for dedup against existing ledger entries
- Confidence scores on every enrichment decision
use ;
use Path;
// Zero-config: auto-detect format and enrich
let result = auto_extract?;
for entry in &result.enriched
// Or opt-in to enrichment via the builder
let config = new
.account
.currency
.use_merchant_dict
.build;
Key Types
| Type | Description |
|---|---|
Importer |
Trait for file importers |
ImporterConfig |
Builder for configuring CSV imports |
ImportResult |
Result containing directives and warnings |
ImporterRegistry |
Registry of available importers |
OfxImporter |
OFX/QFX file importer |
EnrichedImportResult |
Result with confidence scores and fingerprints |
CsvConfigBuilder::use_merchant_dict() |
Enable built-in merchant dictionary |
auto_extract() |
Zero-config import with auto-detection |
Importer Trait
Implement the Importer trait to add support for new file formats:
use ;
use Path;
use Result;
;
License
GPL-3.0