Skip to content

tesujimath/beancount-lima

Repository files navigation

beancount-lima

This is an early stage work-in-progress Beancount frontend using Steel Scheme and the Lima parser.

The observation is that Rust is at the same time both wonderful and uncomfortable for end-users. The idea is to use Steel Scheme for interactive Beancounting.

Instead of Beancount Query Language, Steel Scheme is used.

A number of useful queries are provided out-of-the-box.

Example

aya> lima

     _____ __            __
    / ___// /____  ___  / /          Version 0.7.0
    \__ \/ __/ _ \/ _ \/ /           https://github.com/mattwparas/steel
   ___/ / /_/  __/  __/ /            :? for help
  /____/\__/\___/\___/_/

λ > (display-balance-sheet (cumulate-postings *directives*))
                                           GBP     NZD
Assets:Bank:Current                              -100.78
Assets:Bank:UK                            -5.00
Expenses:Donations                                 10.00
Expenses:Donations:Other                           20.00
Expenses:Entertainment:Drinks-and-snacks           48.00
Expenses:Groceries                         5.00    27.50
Income:Unknown                                     -4.72


λ > (display-rollup (cumulate-postings *directives*))
Assets                                    -100.78
Assets:Bank                                        -100.78
Assets:Bank:Current                                         -100.78
Expenses                                   105.50
Expenses:Donations                                   30.00    10.00
Expenses:Donations:Other                                      20.00
Expenses:Entertainment                               48.00
Expenses:Entertainment:Drinks-and-snacks                      48.00
Expenses:Groceries                                            27.50
Income                                      -4.72
Income:Unknown                                                -4.72

Note: the rollup ignores all but the primary currency (as determined by frequency of use).

Installation and configuration

Currently Lima needs a separate installation of Steel Scheme, for its Scheme cogs, which must be on the LIMA_COGPATH, a colon separated list of directories which are searched in order for modules. (Nothing else from Steel is required to be installed separately.)

Recommended practice for LIMA_COGPATH is local (user) directory for config and own modules, followed by the Lima native one, followed by the Steel one.

Local configuration is done in lima/config.scm which must be on the LIMA_COGPATH. See the example.

Usage Examples

$ lima --help

$ lima

$ lima -o rollup report assets

$ lima -o standalone import kiwibank/*250807.ofx >imported.beancount

$ lima --ledger imported.beancount

$ lima import kiwibank/*250807.ofx >>my-existing.beancount

Import

Import is particularly convenient and addresses pain points I encountered with import using classic Beancount tools.

Balance assertions

A point of difference from classic Beancount is that balance assertions may be configured to assert the total for an account an all its subaccounts, using the lima config item balance-rollup. For example, if a bank account holds multiple logical amounts, they may be tracked as subaccounts, without violating balance assertions.

Padding is only ever performed on the actual account asserted in the balance directive, never on its subaccounts.

The default behaviour is not to do this.

Contributions

While issues are welcome, and I am particularly interested in more example files for import, given the current pace of development I am unlikely to be able to accept PRs for now.

License

Licensed under either of

at your option.

About

Beancount frontend using Steel Scheme and Lima parser

Resources

License

Unknown, MIT licenses found

Licenses found

Unknown
LICENSE-APACHE
MIT
LICENSE-MIT

Stars

Watchers

Forks

Packages

No packages published