Skip to main content

beancount clone in Rust

Project description

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

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

bean_rs-0.3.1.tar.gz (27.4 kB view hashes)

Uploaded Source

Built Distributions

bean_rs-0.3.1-pp310-pypy310_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.1 MB view hashes)

Uploaded PyPy manylinux: glibc 2.17+ x86-64

bean_rs-0.3.1-pp39-pypy39_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.1 MB view hashes)

Uploaded PyPy manylinux: glibc 2.17+ x86-64

bean_rs-0.3.1-cp312-none-win_amd64.whl (254.5 kB view hashes)

Uploaded CPython 3.12 Windows x86-64

bean_rs-0.3.1-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.1 MB view hashes)

Uploaded CPython 3.12 manylinux: glibc 2.17+ x86-64

bean_rs-0.3.1-cp312-cp312-macosx_11_0_arm64.whl (342.3 kB view hashes)

Uploaded CPython 3.12 macOS 11.0+ ARM64

bean_rs-0.3.1-cp311-none-win_amd64.whl (254.5 kB view hashes)

Uploaded CPython 3.11 Windows x86-64

bean_rs-0.3.1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.1 MB view hashes)

Uploaded CPython 3.11 manylinux: glibc 2.17+ x86-64

bean_rs-0.3.1-cp311-cp311-macosx_11_0_arm64.whl (342.9 kB view hashes)

Uploaded CPython 3.11 macOS 11.0+ ARM64

bean_rs-0.3.1-cp310-none-win_amd64.whl (254.6 kB view hashes)

Uploaded CPython 3.10 Windows x86-64

bean_rs-0.3.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.1 MB view hashes)

Uploaded CPython 3.10 manylinux: glibc 2.17+ x86-64

bean_rs-0.3.1-cp39-none-win_amd64.whl (254.8 kB view hashes)

Uploaded CPython 3.9 Windows x86-64

bean_rs-0.3.1-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.1 MB view hashes)

Uploaded CPython 3.9 manylinux: glibc 2.17+ x86-64

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page