Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/carderne/bean-rs
beancount clone in Rust
https://github.com/carderne/bean-rs
accounting beancount plaintext-accounting
Last synced: 3 months ago
JSON representation
beancount clone in Rust
- Host: GitHub
- URL: https://github.com/carderne/bean-rs
- Owner: carderne
- License: mit
- Created: 2024-01-14T14:28:10.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2024-05-20T19:35:20.000Z (9 months ago)
- Last Synced: 2024-09-17T20:09:57.051Z (5 months ago)
- Topics: accounting, beancount, plaintext-accounting
- Language: Rust
- Homepage: https://crates.io/crates/bean-rs
- Size: 83 KB
- Stars: 2
- Watchers: 1
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# bean-rs
**Project paused until [this PR in PyO3](https://github.com/PyO3/pyo3/pull/4135) (or something similar) gets merged.**
Basic [beancount](https://github.com/beancount/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](https://pyo3.rs);
The libraries:
- Rust: [crates/bean-rs](https://crates.io/crates/bean-rs)
- Python: [pypi/bean-rs](https://pypi.org/project/bean-rs/)Planned features:
- [x] Parse beancount files using [pest](https://pest.rs/)
- [x] Stricter transaction keywords
- [x] Propagate line numbers for debugging
- [x] Calculate account balances
- [x] Use proper Decimal handling
- [x] Validate transactions against `open`/`close` directives
- [x] Validate `balance` directives
- [x] Pad statements
- [x] Open/close with multiple currencies
- [x] 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
```bash
cargo install bean-rs
```### Run
```bash
$ bean-rsUsage: bean-rs
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
```bash
bean-rs balance example.bean
```## Use from Python
More to come...
```python
import bean_rs
ledger = bean_rs.py_load("example.bean")
print(ledger.opts)
```## Development
### Build
```bash
make build
```### Test
```bash
make test
```