Skip to content

feat(importer): add transaction import system with CSV and OFX support - #24

Merged
robcohen merged 5 commits into
mainfrom
feat/import-system
Jan 11, 2026
Merged

robcohen merged 5 commits into
mainfrom
feat/import-system

Conversation

@robcohen

Copy link
Copy Markdown
Member

Summary

  • Add bean-extract/rledger-extract command for importing transactions
  • Add CSV importer with configurable column mappings
  • Add OFX/QFX bank statement importer
  • Matches beancount's bean-extract functionality

Test plan

  • cargo test passes
  • Test CSV import with sample files
  • Test OFX import with bank statements

🤖 Generated with Claude Code

robcohen and others added 4 commits January 10, 2026 18:11
Add new rustledger-importer crate with:
- Importer trait for extensible import framework
- CSV importer with configurable columns/formats
- ImporterRegistry for managing multiple importers
- rledger-extract and bean-extract CLI commands

Features:
- Flexible column mapping (by name or index)
- Support for combined or separate debit/credit columns
- Configurable date formats
- Currency specification
- Sign inversion option
- Warning collection for parse errors

Example usage:
  rledger-extract bank.csv --account Assets:Bank:Checking

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <[email protected]>
Add support for importing transactions from OFX (Open Financial Exchange)
and QFX (Quicken Financial Exchange) files commonly exported by banks.

Features:
- Parse bank and credit card transaction lists
- Extract date, amount, payee, and memo from transactions
- Automatic currency detection from statement
- Create balanced transactions with Unknown expense/income accounts
- Support for both .ofx and .qfx file extensions

Uses the ofxy crate for robust OFX parsing.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <[email protected]>
@codecov

codecov Bot commented Jan 11, 2026 •

Copy link
Copy Markdown

@github-actions

github-actions Bot commented Jan 11, 2026 •

Copy link
Copy Markdown
Contributor

Benchmark Results

Comparing main (base) vs feat/import-system (pr)

group                                     base                                     pr
-----                                     ----                                     --
inventory_add/10                          1.00   575.2±25.94ns 16.6 MElem/sec      1.00    572.8±4.80ns 16.7 MElem/sec
inventory_add/100                         1.01      5.8±0.49µs 16.5 MElem/sec      1.00      5.7±0.11µs 16.6 MElem/sec
inventory_add/1000                        1.19    101.2±4.54µs  9.4 MElem/sec      1.00     85.0±1.17µs 11.2 MElem/sec
inventory_at_cost/10                      1.01    337.9±3.90ns        ? ?/sec      1.00    335.5±2.14ns        ? ?/sec
inventory_at_cost/100                     1.00      3.4±0.02µs        ? ?/sec      1.00      3.4±0.02µs        ? ?/sec
inventory_at_cost/1000                    1.01     33.9±0.19µs        ? ?/sec      1.00     33.5±0.19µs        ? ?/sec
inventory_book_value/10                   1.02    498.7±5.70ns        ? ?/sec      1.00    490.5±2.10ns        ? ?/sec
inventory_book_value/100                  1.00      4.6±0.21µs        ? ?/sec      1.00      4.6±0.02µs        ? ?/sec
inventory_book_value/1000                 1.00     46.0±0.19µs        ? ?/sec      1.01     46.3±0.64µs        ? ?/sec
inventory_merge/10                        1.01    244.2±4.41ns        ? ?/sec      1.00    240.7±6.69ns        ? ?/sec
inventory_merge/100                       1.00      2.1±0.04µs        ? ?/sec      1.02      2.2±0.03µs        ? ?/sec
inventory_merge/500                       1.01     10.5±0.12µs        ? ?/sec      1.00     10.3±0.21µs        ? ?/sec
inventory_units/10                        1.03    117.1±0.41ns        ? ?/sec      1.00    114.0±0.48ns        ? ?/sec
inventory_units/100                       1.03   1139.7±4.92ns        ? ?/sec      1.00   1106.8±1.38ns        ? ?/sec
inventory_units/1000                      1.03     11.4±0.04µs        ? ?/sec      1.00     11.1±0.04µs        ? ?/sec
parse_large/1000_transactions             1.00      9.9±0.08ms    10.4 MB/sec      1.01     10.0±0.11ms    10.3 MB/sec
parse_medium/100_transactions             1.00  1028.5±18.17µs    10.1 MB/sec      1.00  1030.1±17.11µs    10.1 MB/sec
parse_scaling/10                          1.00    124.6±1.59µs     9.5 MB/sec      1.00    124.5±0.94µs     9.5 MB/sec
parse_scaling/100                         1.00  1005.9±10.54µs    10.3 MB/sec      1.02  1022.4±17.28µs    10.2 MB/sec
parse_scaling/1000                        1.00      9.9±0.09ms    10.5 MB/sec      1.00      9.9±0.06ms    10.5 MB/sec
parse_scaling/50                          1.00    512.5±4.22µs    10.3 MB/sec      1.01   519.8±11.86µs    10.1 MB/sec
parse_scaling/500                         1.00      4.9±0.11ms    10.5 MB/sec      1.01      5.0±0.04ms    10.4 MB/sec
parse_small/10_transactions               1.00    123.3±2.72µs     9.6 MB/sec      1.01    124.2±1.40µs     9.6 MB/sec
pipeline_full/1000_txns                   1.03     14.1±0.10ms 69.2 KElem/sec      1.00     13.6±0.10ms 71.6 KElem/sec
pipeline_full/100_txns                    1.03  1495.3±28.29µs 65.3 KElem/sec      1.00  1447.8±56.83µs 67.5 KElem/sec
pipeline_full/500_txns                    1.04      7.1±0.04ms 68.4 KElem/sec      1.00      6.9±0.04ms 71.0 KElem/sec
pipeline_parse/1000_txns                  1.03     12.9±0.07ms     7.8 MB/sec      1.00     12.5±0.09ms     8.0 MB/sec
pipeline_parse/100_txns                   1.04  1354.1±27.17µs     7.7 MB/sec      1.00  1304.3±11.61µs     8.0 MB/sec
pipeline_parse/5000_txns                  1.03     67.2±1.51ms     7.5 MB/sec      1.00     65.4±2.30ms     7.7 MB/sec
pipeline_parse/500_txns                   1.04      6.5±0.06ms     7.7 MB/sec      1.00      6.3±0.04ms     8.0 MB/sec
pipeline_parse_validate/1000_txns         1.04     13.7±0.06ms 71.4 KElem/sec      1.00     13.2±0.10ms 74.0 KElem/sec
pipeline_parse_validate/100_txns          1.03  1446.3±10.34µs 67.5 KElem/sec      1.00  1402.2±47.48µs 69.6 KElem/sec
pipeline_parse_validate/500_txns          1.03      6.9±0.06ms 70.9 KElem/sec      1.00      6.7±0.05ms 73.3 KElem/sec
query_balances/balances                   1.00     99.3±0.94µs  9.6 MElem/sec      1.02    101.5±0.76µs  9.4 MElem/sec
query_group_by/group_by_account_sum       1.01    637.9±8.61µs 1531.0 KElem/sec    1.00    633.9±4.09µs 1540.5 KElem/sec
query_scaling/100                         1.02     66.1±3.62µs 1478.5 KElem/sec    1.00     64.9±0.60µs 1505.1 KElem/sec
query_scaling/1000                        1.00    635.7±6.84µs 1536.2 KElem/sec    1.00    633.6±6.93µs 1541.3 KElem/sec
query_scaling/500                         1.00    322.5±4.54µs 1514.1 KElem/sec    1.00    321.7±2.21µs 1518.0 KElem/sec
query_scaling/5000                        1.00      3.1±0.05ms 1569.8 KElem/sec    1.00      3.1±0.16ms 1566.9 KElem/sec
query_simple_select/select_all_columns    1.00   630.2±10.12µs 1549.6 KElem/sec    1.01    636.7±6.38µs 1533.7 KElem/sec
query_where/where_account_contains        1.00    578.4±2.91µs 1688.4 KElem/sec    1.00   579.4±10.44µs 1685.6 KElem/sec
reduce_fifo/10                            1.00  1797.8±88.72ns        ? ?/sec      1.04  1874.0±50.18ns        ? ?/sec
reduce_fifo/100                           1.00    134.9±2.24µs        ? ?/sec      1.02    137.5±2.55µs        ? ?/sec
reduce_fifo/500                           1.00      3.1±0.01ms        ? ?/sec      1.01      3.2±0.01ms        ? ?/sec
reduce_lifo/10                            1.00  1751.3±54.58ns        ? ?/sec      1.04  1819.0±24.04ns        ? ?/sec
reduce_lifo/100                           1.00    135.7±4.27µs        ? ?/sec      1.04    140.9±2.10µs        ? ?/sec
reduce_lifo/500                           1.00      3.2±0.01ms        ? ?/sec      1.01      3.2±0.01ms        ? ?/sec
reduce_strict/10                          1.00   259.4±10.78ns        ? ?/sec      1.00   259.8±10.99ns        ? ?/sec
reduce_strict/100                         1.01   855.3±49.40ns        ? ?/sec      1.00   843.1±24.49ns        ? ?/sec
reduce_strict/500                         1.00      4.1±0.10µs        ? ?/sec      1.01      4.2±0.33µs        ? ?/sec
throughput/10k_transactions               1.01    132.9±1.95ms 73.5 KElem/sec      1.00    131.9±3.69ms 74.0 KElem/sec
validate_balance_assertions/10            1.00      3.7±0.04µs  2.6 MElem/sec      1.01      3.8±0.03µs  2.5 MElem/sec
validate_balance_assertions/100           1.00     33.8±0.53µs  2.8 MElem/sec      1.03     34.8±0.24µs  2.7 MElem/sec
validate_balance_assertions/50            1.00     17.0±0.10µs  2.8 MElem/sec      1.01     17.2±0.18µs  2.8 MElem/sec
validate_valid/100                        1.00     34.1±0.20µs  2.8 MElem/sec      1.01     34.4±0.27µs  2.8 MElem/sec
validate_valid/1000                       1.00    113.2±1.16µs  8.4 MElem/sec      1.02    115.8±3.59µs  8.2 MElem/sec
validate_valid/500                        1.00    114.6±1.33µs  4.2 MElem/sec      1.00    114.9±0.88µs  4.2 MElem/sec
validate_valid/5000                       1.00    113.9±0.82µs 41.9 MElem/sec      1.00    114.4±0.63µs 41.7 MElem/sec
validate_with_errors/100                  1.00     33.2±0.67µs  2.9 MElem/sec      1.00     33.3±0.16µs  2.9 MElem/sec
validate_with_errors/1000                 1.00    345.4±2.18µs  2.8 MElem/sec      1.01    348.1±4.05µs  2.7 MElem/sec
validate_with_errors/500                  1.01    174.9±1.70µs  2.7 MElem/sec      1.00    173.3±2.00µs  2.8 MElem/sec

Legend
  • Ratio < 1.0: PR is faster (improvement)
  • Ratio > 1.0: PR is slower (regression)
  • Differences within ~5% are typically noise

- Remove unnecessary raw string hashes (needless_raw_string_hashes)
- Use map_or_else instead of map().unwrap_or_else() (map_unwrap_or)
- Inline format arguments (uninlined_format_args)
- Use &'static str for literal return (unnecessary_literal_bound)
- Fix import ordering

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <[email protected]>
@robcohen
robcohen added this pull request to the merge queue Jan 11, 2026
Merged via the queue into main with commit 24957e6 Jan 11, 2026
@robcohen
robcohen deleted the feat/import-system branch January 11, 2026 03:28
robcohen added a commit that referenced this pull request Jan 14, 2026
feat(importer): add transaction import system with CSV and OFX support
robcohen added a commit that referenced this pull request Jan 14, 2026
feat(importer): add transaction import system with CSV and OFX support
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant