Skip to main content

Crate rustledger_importer

Crate rustledger_importer 

Source
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§

EnrichedImportResult
Result of an enriched import operation.
ImportResult
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).