Skip to content

Latest commit

 

History

History
74 lines (53 loc) · 3.07 KB

README.md

File metadata and controls

74 lines (53 loc) · 3.07 KB

StatementForge

Support curvecoder on Ko-fi

High-performance, domain-agnostic .NET streaming parser and algorithmic analyzer for financial statements (OFX 1.x/2.x, QFX, delimited CSV/TSV) featuring label normalization, fuzzy duplicate detection, recurring cadence analysis, and sliding budget period calculations.

License: MIT Framework Documentation: English Documentation: Français

📖 Framework Documentation: English Specification | Spécification en français


Key Capabilities

1. Banking Format Streaming Parsers (StatementForge.Parsing)

  • IBankStatementParser: Unified asynchronous streaming interface.
  • OfxStatementParser:
    • Native parser for OFX 1.x (SGML unclosed tags) and OFX 2.x (XML standards) without external heavy dependencies.
    • Streaming block segmentation (<STMTTRN>) with strict ReDoS timeouts.
    • Non-destructive static banking account extraction via ExtractOfxAccountIdAsync (<ACCTID>).
    • Signed amount normalization (TRNAMT) into explicit Debit/Credit representations and ISO banking timestamp extraction (YYYYMMDD).
  • CsvStatementParser:
    • RFC 4180 compliant CSV and TSV parsing with configurable column index mappings (CsvStatementOptions).
    • Multi-cultural parsing tolerance for comma/period decimal notations, currency symbols (€, $, EUR, USD), and whitespace.

2. Algorithmic Statement Intelligence (StatementForge.Analysis)

  • StatementLabelAnalyzer:
    • Cleans banking noise prefixes (PRLV SEPA, VIR, CB, transaction dates, card masks X4242) while isolating business descriptors.
    • Title Case emitter normalization and wildcard/regex pattern matching.
    • Inter-export fuzzy duplicate detection based on token set overlap.
  • RecurringCadenceAnalyzer:
    • Statistical cadence detection for monthly, quarterly, and annual subscription cycles.
    • Algorithmic confidence scoring (50% to 98%).
  • BudgetPeriodCalculator:
    • Computes dynamic rolling periods (two-weeks, three-months, six-months) and customizable budget cycles (start days 1 to 28).

Installation

Add the package via the .NET CLI:

dotnet add package StatementForge --version 1.1.1

Quick Example

using StatementForge.Parsing;

var parser = new OfxStatementParser();

using var fileStream = File.OpenRead("bank_statement.ofx");
var transactions = await parser.ParseAsync(fileStream);

foreach (var tx in transactions)
{
    Console.WriteLine($"{tx.Date:yyyy-MM-dd} | {tx.Type} | {tx.Amount} | {tx.Label}");
}

License

This project is licensed under the MIT License © 2026 curvecoder.