Skip to content

feat(report): add financial reports with CSV/JSON export - #23

Merged
robcohen merged 5 commits into
mainfrom
feat/reports-export
Jan 11, 2026
Merged

robcohen merged 5 commits into
mainfrom
feat/reports-export

Conversation

@robcohen

Copy link
Copy Markdown
Member

Summary

  • Add 5 new financial reports: trial balance, holdings, net worth, cash flow, account
  • Add CSV and JSON export formats for all reports
  • Matches beancount's bean-report functionality

Test plan

  • cargo test passes
  • Manual testing of each report type
  • Verify CSV/JSON output formats

🤖 Generated with Claude Code

robcohen and others added 4 commits January 10, 2026 18:10
Add new report types to match Python beancount functionality:
- balsheet: Balance sheet (Assets, Liabilities, Equity)
- income: Income statement (Income and Expenses)
- journal: Transaction journal/register with filtering
- holdings: Investment holdings with cost basis
- networth: Net worth over time (daily/weekly/monthly/yearly)

These reports close the gap with Python beancount's bean-report
command and provide essential financial analysis capabilities.

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

Co-Authored-By: Claude Opus 4.5 <[email protected]>
Add -f/--format flag to rledger-report command supporting text (default),
csv, and json output formats. All reports now support these formats:
- balances: account balances with currency
- accounts: list of accounts
- commodities: list of commodities
- prices: price history
- balsheet: balance sheet with sections
- income: income statement with sections
- journal: transaction register
- holdings: positions with cost basis
- networth: net worth over time

🤖 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

Codecov Report

❌ Patch coverage is 0% with 643 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
crates/rustledger/src/cmd/report_cmd.rs 0.00% 643 Missing ⚠️

📢 Thoughts on this report? Let us know!

@github-actions

github-actions Bot commented Jan 11, 2026 •

Copy link
Copy Markdown
Contributor

Benchmark Results

Comparing main (base) vs feat/reports-export (pr)

group                                     base                                     pr
-----                                     ----                                     --
inventory_add/10                          1.00    562.0±4.27ns 17.0 MElem/sec      1.08    604.5±4.47ns 15.8 MElem/sec
inventory_add/100                         1.00      5.8±0.09µs 16.6 MElem/sec      1.01      5.8±0.11µs 16.5 MElem/sec
inventory_add/1000                        1.00     85.0±2.17µs 11.2 MElem/sec      1.20    101.8±1.35µs  9.4 MElem/sec
inventory_at_cost/10                      1.01    338.7±1.92ns        ? ?/sec      1.00    335.7±1.41ns        ? ?/sec
inventory_at_cost/100                     1.00      3.4±0.02µs        ? ?/sec      1.00      3.3±0.01µs        ? ?/sec
inventory_at_cost/1000                    1.00     33.6±0.15µs        ? ?/sec      1.00     33.7±0.36µs        ? ?/sec
inventory_book_value/10                   1.00    496.2±6.04ns        ? ?/sec      1.00    495.9±3.75ns        ? ?/sec
inventory_book_value/100                  1.00      4.6±0.03µs        ? ?/sec      1.00      4.6±0.03µs        ? ?/sec
inventory_book_value/1000                 1.01     46.2±0.62µs        ? ?/sec      1.00     45.7±0.36µs        ? ?/sec
inventory_merge/10                        1.00    240.1±6.02ns        ? ?/sec      1.04    250.7±6.96ns        ? ?/sec
inventory_merge/100                       1.00      2.2±0.06µs        ? ?/sec      1.02      2.2±0.07µs        ? ?/sec
inventory_merge/500                       1.00     10.5±0.28µs        ? ?/sec      1.00     10.5±0.36µs        ? ?/sec
inventory_units/10                        1.00    114.0±0.18ns        ? ?/sec      1.00    114.3±2.01ns        ? ?/sec
inventory_units/100                       1.00   1108.2±7.02ns        ? ?/sec      1.00   1108.2±5.08ns        ? ?/sec
inventory_units/1000                      1.00     11.1±0.03µs        ? ?/sec      1.00     11.2±0.02µs        ? ?/sec
parse_large/1000_transactions             1.00      9.8±0.08ms    10.5 MB/sec      1.03     10.2±0.12ms    10.2 MB/sec
parse_medium/100_transactions             1.00  1009.4±13.79µs    10.3 MB/sec      1.01  1018.3±42.99µs    10.2 MB/sec
parse_scaling/10                          1.00    123.9±1.22µs     9.6 MB/sec      1.00    123.7±1.70µs     9.6 MB/sec
parse_scaling/100                         1.01   1017.1±9.23µs    10.2 MB/sec      1.00  1010.7±12.20µs    10.3 MB/sec
parse_scaling/1000                        1.00      9.9±0.13ms    10.4 MB/sec      1.03     10.2±0.10ms    10.1 MB/sec
parse_scaling/50                          1.01    520.3±3.50µs    10.1 MB/sec      1.00    515.3±4.12µs    10.2 MB/sec
parse_scaling/500                         1.00      4.9±0.02ms    10.5 MB/sec      1.01      5.0±0.08ms    10.4 MB/sec
parse_small/10_transactions               1.00    123.0±1.64µs     9.7 MB/sec      1.00    123.0±1.49µs     9.7 MB/sec
pipeline_full/1000_txns                   1.06     14.4±0.10ms 67.9 KElem/sec      1.00     13.6±0.07ms 71.9 KElem/sec
pipeline_full/100_txns                    1.04  1489.4±30.58µs 65.6 KElem/sec      1.00  1431.8±36.71µs 68.2 KElem/sec
pipeline_full/500_txns                    1.05      7.2±0.05ms 68.0 KElem/sec      1.00      6.8±0.03ms 71.7 KElem/sec
pipeline_parse/1000_txns                  1.06     13.1±0.07ms     7.6 MB/sec      1.00     12.4±0.06ms     8.1 MB/sec
pipeline_parse/100_txns                   1.03  1347.8±17.30µs     7.7 MB/sec      1.00  1312.9±13.78µs     7.9 MB/sec
pipeline_parse/5000_txns                  1.04     68.0±1.40ms     7.4 MB/sec      1.00     65.3±1.58ms     7.7 MB/sec
pipeline_parse/500_txns                   1.04      6.5±0.04ms     7.7 MB/sec      1.00      6.3±0.16ms     8.0 MB/sec
pipeline_parse_validate/1000_txns         1.06     13.9±0.06ms 70.2 KElem/sec      1.00     13.1±0.06ms 74.5 KElem/sec
pipeline_parse_validate/100_txns          1.03  1437.7±11.30µs 67.9 KElem/sec      1.00  1390.3±32.94µs 70.2 KElem/sec
pipeline_parse_validate/500_txns          1.05      6.9±0.04ms 70.4 KElem/sec      1.00      6.6±0.08ms 74.0 KElem/sec
query_balances/balances                   1.04    104.8±1.79µs  9.1 MElem/sec      1.00    100.9±0.78µs  9.4 MElem/sec
query_group_by/group_by_account_sum       1.00    631.7±9.15µs 1545.9 KElem/sec    1.01    638.5±6.70µs 1529.6 KElem/sec
query_scaling/100                         1.00     65.2±0.48µs 1497.7 KElem/sec    1.02     66.6±1.05µs 1465.4 KElem/sec
query_scaling/1000                        1.00   638.5±12.99µs 1529.6 KElem/sec    1.00   641.0±15.04µs 1523.5 KElem/sec
query_scaling/500                         1.00    322.1±3.38µs 1516.0 KElem/sec    1.00    322.1±2.63µs 1515.9 KElem/sec
query_scaling/5000                        1.03      3.4±0.18ms 1447.1 KElem/sec    1.00      3.3±0.08ms 1492.6 KElem/sec
query_simple_select/select_all_columns    1.01    632.4±5.04µs 1544.1 KElem/sec    1.00    626.1±2.35µs 1559.7 KElem/sec
query_where/where_account_contains        1.00    577.5±3.76µs 1691.0 KElem/sec    1.01    580.9±6.19µs 1681.1 KElem/sec
reduce_fifo/10                            1.03  1858.0±39.08ns        ? ?/sec      1.00  1796.6±24.06ns        ? ?/sec
reduce_fifo/100                           1.00    134.8±2.14µs        ? ?/sec      1.04    140.0±5.84µs        ? ?/sec
reduce_fifo/500                           1.04      3.3±0.04ms        ? ?/sec      1.00      3.2±0.01ms        ? ?/sec
reduce_lifo/10                            1.04  1820.3±33.59ns        ? ?/sec      1.00  1748.2±42.47ns        ? ?/sec
reduce_lifo/100                           1.01    136.9±4.04µs        ? ?/sec      1.00    135.7±3.81µs        ? ?/sec
reduce_lifo/500                           1.03      3.4±0.05ms        ? ?/sec      1.00      3.3±0.05ms        ? ?/sec
reduce_strict/10                          1.00   274.8±30.79ns        ? ?/sec      1.00   275.8±30.61ns        ? ?/sec
reduce_strict/100                         1.00  943.6±113.70ns        ? ?/sec      1.01   955.1±95.63ns        ? ?/sec
reduce_strict/500                         1.00      4.2±0.18µs        ? ?/sec      1.05      4.4±0.31µs        ? ?/sec
throughput/10k_transactions               1.05    136.2±1.60ms 71.7 KElem/sec      1.00    130.2±2.35ms 75.0 KElem/sec
validate_balance_assertions/10            1.00      3.8±0.04µs  2.5 MElem/sec      1.00      3.8±0.03µs  2.5 MElem/sec
validate_balance_assertions/100           1.01     34.5±0.40µs  2.8 MElem/sec      1.00     34.3±0.36µs  2.8 MElem/sec
validate_balance_assertions/50            1.00     17.1±0.19µs  2.8 MElem/sec      1.01     17.2±0.17µs  2.8 MElem/sec
validate_valid/100                        1.00     34.4±0.29µs  2.8 MElem/sec      1.00     34.2±0.42µs  2.8 MElem/sec
validate_valid/1000                       1.00    115.4±1.16µs  8.3 MElem/sec      1.01    116.1±0.83µs  8.2 MElem/sec
validate_valid/500                        1.00    115.2±1.34µs  4.1 MElem/sec      1.00    115.4±1.01µs  4.1 MElem/sec
validate_valid/5000                       1.01    115.8±0.64µs 41.2 MElem/sec      1.00    115.1±1.26µs 41.4 MElem/sec
validate_with_errors/100                  1.00     32.6±0.69µs  2.9 MElem/sec      1.02     33.4±0.72µs  2.9 MElem/sec
validate_with_errors/1000                 1.01    351.5±5.74µs  2.7 MElem/sec      1.00    348.8±5.87µs  2.7 MElem/sec
validate_with_errors/500                  1.00    174.7±2.48µs  2.7 MElem/sec      1.00    175.3±3.11µs  2.7 MElem/sec

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

@robcohen
robcohen added this pull request to the merge queue Jan 11, 2026
Merged via the queue into main with commit 0e5273c Jan 11, 2026
@robcohen
robcohen deleted the feat/reports-export branch January 11, 2026 03:28
robcohen added a commit that referenced this pull request Jan 14, 2026
feat(report): add financial reports with CSV/JSON export
robcohen added a commit that referenced this pull request Jan 14, 2026
feat(report): add financial reports with CSV/JSON export
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