10 releases

0.3.1 Apr 29, 2024
0.3.0 Apr 15, 2024
0.2.2 Apr 9, 2024
0.1.6 Apr 9, 2024
0.1.5 Jan 24, 2024

#323 in Database interfaces

Download history 8/week @ 2024-01-16 9/week @ 2024-01-23 1/week @ 2024-02-13 4/week @ 2024-02-20 497/week @ 2024-04-09 86/week @ 2024-04-16 102/week @ 2024-04-23 60/week @ 2024-04-30

745 downloads per month

MIT license

58KB
1.5K SLoC

bean-rs

Basic beancount clone (one day...) in Rust!

Still very very alpha and doesn't do most things that are necessary to be at all useful.

Python bindings are a WIP using PyO3;

The libraries:

Planned features:

  • Parse beancount files using pest
  • Stricter transaction keywords
  • Propagate line numbers for debugging
  • Calculate account balances
  • Use proper Decimal handling
  • Validate transactions against open/close directives
  • Validate balance directives
  • Pad statements
  • Open/close with multiple currencies
  • Add Python bindings
  • Support includes
  • Come up with a more punny name
  • Currency conversions
  • Price/cost and FIFO

(Deliberate) differences from beancount

  • Postings can't omit the currency

Use from Rust

Install

cargo install bean-rs

Run

$ bean-rs

Usage: bean-rs <COMMAND>

Commands:
  balance  Display account balances
  check    Check for errors and quit
  help     Print this message or the help of the given subcommand(s)

Options:
  -h, --help     Print help
  -V, --version  Print version

Calculate balances

bean-rs balance example.bean

Use from Python

More to come...

import bean_rs
ledger = bean_rs.py_load("example.bean")
print(ledger.opts)

Development

Build

make build

Test

make test

Dependencies

~8–15MB
~177K SLoC