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::{Importer, ImporterConfig, extract_from_file};
use rustledger_core::Directive;
use std::path::Path;
// Create a CSV importer configuration
let config = ImporterConfig::csv()
.account("Assets:Bank:Checking")
.date_column("Date")
.narration_column("Description")
.amount_column("Amount")
.build();
// Extract transactions from a file
// let directives = extract_from_file(Path::new("bank.csv"), &config)?;Re-exports§
pub use config::ImporterConfig;pub use ofx_importer::OfxImporter;pub use registry::ImporterRegistry;
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.
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.
- extract_
from_ file - Extract transactions from a file using the given configuration.
- extract_
from_ string - Extract transactions from file contents (useful for testing).