Skip to main content

uromyces implements parts of Beancount's plain text accounting functionality in Rust

Project description

uro(myces)

uromyces is a toy Rust re-implementation of parts of Beancount's functionality.

How to use / run

You can use the provided Makefile to set up a virtualenv (at .venv) and install uromyces in it with make dev and then try out e.g. uro check -v $BEANCOUNT_FILE to run a bean-check like script that will do a full parse and print out any errors. There is also a uro compare command to print out differences between Beancount and uromyces.

For more elaborate playing around it's probably best to write a Python script that uses the uromyces.load_file function.

Components

Just like Beancount, this tries to go from an input file to an usable result of entries.

It does so in the following series of steps.

  1. Parse single files with a tree-sitter grammar to obtain abstract syntax trees.
  2. Convert the syntax tree to produce Rust data structures.
  3. Combine the parsed results from multiple files and run initial validations.
  4. Booking
  5. Plugins
  6. Validation

Performance

On my personal ledger, this is faster than Beancount as follows:

  • parsing is about 2x faster
  • booking is about 40x faster
  • plugins for documents, implicit prices and validations each about 10x faster

Parsing

There's quite some room for improvement in the parser surely, it hasn't been the focus so far. Since the parser does more work per-file, parallelisation with rayon maybe could give nice speed-ups for users who have multiple includes. There's a couple other Rust parser implementations for Beancount already, maybe one of them could be adapted as well. With caching, the parsing performance should not be that relevant since we only need to reparse files that changed.

Imcremental computation

In the context of Fava, using salsa-rs ("A generic framework for on-demand, incrementalized computation.") seems like a good fit to speed up the incremental re-parses and more of a modified ledger.

Differences to Beancount (V3)

  • Not a lot of attention has been placed on generating the same kinds of errors. So, e.g., for a transaction that does not balance, the error messages from Beancount might be quite different.
  • The automatic filling of missing currencies is stricter (less powerful) than the one by Beancount and only takes the account balances into account to infer cost currencies. IMHO leaving out currencies should be discouraged and making this depend on the previous account balance seems error-prone.
  • Likewise, the interpolation is less powerful. For example it won't be able to interpolate a missing total cost. Interpolating total cost seems to be rather an edge case anyway.
  • The (deprecated) total cost syntax ({{}}) is not supported.
  • Deprecated options are not supported.
  • The options account_rounding, infer_tolerance_from_cost, and plugin_processing_mode are not supported.

Etymology

The name is derived from the genus of rust fungi that can befall bean plants.

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

uromyces-0.0.3.tar.gz (267.8 kB view details)

Uploaded Source

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

uromyces-0.0.3-cp310-abi3-win_arm64.whl (1.2 MB view details)

Uploaded CPython 3.10+Windows ARM64

uromyces-0.0.3-cp310-abi3-win_amd64.whl (1.3 MB view details)

Uploaded CPython 3.10+Windows x86-64

uromyces-0.0.3-cp310-abi3-manylinux_2_28_x86_64.whl (1.6 MB view details)

Uploaded CPython 3.10+manylinux: glibc 2.28+ x86-64

uromyces-0.0.3-cp310-abi3-manylinux_2_28_aarch64.whl (1.6 MB view details)

Uploaded CPython 3.10+manylinux: glibc 2.28+ ARM64

uromyces-0.0.3-cp310-abi3-macosx_11_0_arm64.whl (1.5 MB view details)

Uploaded CPython 3.10+macOS 11.0+ ARM64

uromyces-0.0.3-cp310-abi3-macosx_10_12_x86_64.whl (1.5 MB view details)

Uploaded CPython 3.10+macOS 10.12+ x86-64

File details

Details for the file uromyces-0.0.3.tar.gz.

File metadata

  • Download URL: uromyces-0.0.3.tar.gz
  • Upload date:
  • Size: 267.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.9.26 {"installer":{"name":"uv","version":"0.9.26","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for uromyces-0.0.3.tar.gz
Algorithm Hash digest
SHA256 988f9f55c9313a2ff1d14d7de1ca389a2fdfcd1094a22e29eafe07342f6cbcc0
MD5 c5af6370c85786bde2e828388b4e88e6
BLAKE2b-256 1aab18a95737fdf215941d2cad45c1050abd7974cdb1067ba25350352dff369f

See more details on using hashes here.

File details

Details for the file uromyces-0.0.3-cp310-abi3-win_arm64.whl.

File metadata

  • Download URL: uromyces-0.0.3-cp310-abi3-win_arm64.whl
  • Upload date:
  • Size: 1.2 MB
  • Tags: CPython 3.10+, Windows ARM64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.9.26 {"installer":{"name":"uv","version":"0.9.26","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for uromyces-0.0.3-cp310-abi3-win_arm64.whl
Algorithm Hash digest
SHA256 b020c1adfdf5a75d92ee0d3e1e0439b6ec699f00390a820dd3c50ed53756faae
MD5 ad2432233ee43f8f2c595b95f741abea
BLAKE2b-256 bf361adc9fec259c85a4f3a3b3ec58cbe46bd6ff71a8cfdfbcac3f7167781413

See more details on using hashes here.

File details

Details for the file uromyces-0.0.3-cp310-abi3-win_amd64.whl.

File metadata

  • Download URL: uromyces-0.0.3-cp310-abi3-win_amd64.whl
  • Upload date:
  • Size: 1.3 MB
  • Tags: CPython 3.10+, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.9.26 {"installer":{"name":"uv","version":"0.9.26","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for uromyces-0.0.3-cp310-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 153a7d9e933b5043c680cbf70e618b329bde6a8349d9ea9c0e5780f1aae7a585
MD5 7229304b34325aedce25d631b54ad8db
BLAKE2b-256 0468bbc2d7b1d1cc62b4a98e2e6ae851077ff6b9d824abaf522613947ebfa663

See more details on using hashes here.

File details

Details for the file uromyces-0.0.3-cp310-abi3-manylinux_2_28_x86_64.whl.

File metadata

  • Download URL: uromyces-0.0.3-cp310-abi3-manylinux_2_28_x86_64.whl
  • Upload date:
  • Size: 1.6 MB
  • Tags: CPython 3.10+, manylinux: glibc 2.28+ x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.9.26 {"installer":{"name":"uv","version":"0.9.26","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for uromyces-0.0.3-cp310-abi3-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 c051430e583aed3058df5c4cf18941a848e0d0f20f0828daa5e4f462b18c9d03
MD5 78354f78fc9cfaa17e5297727119e74d
BLAKE2b-256 6353daf328e6faaab852feb2cb013131c7d1c61be98379c59378ed866e67eaef

See more details on using hashes here.

File details

Details for the file uromyces-0.0.3-cp310-abi3-manylinux_2_28_aarch64.whl.

File metadata

  • Download URL: uromyces-0.0.3-cp310-abi3-manylinux_2_28_aarch64.whl
  • Upload date:
  • Size: 1.6 MB
  • Tags: CPython 3.10+, manylinux: glibc 2.28+ ARM64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.9.26 {"installer":{"name":"uv","version":"0.9.26","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for uromyces-0.0.3-cp310-abi3-manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 9f4fa830ee672f48e47570f168a9a3c1cddd3e05af5e38b07864c7f74919eb8a
MD5 e6806be1e3bdd64aac3d6552e5845dc4
BLAKE2b-256 e50d49daf8e3c56268c9581e993b8e0e53f9299fb2bfacfbc80854fa78c572f7

See more details on using hashes here.

File details

Details for the file uromyces-0.0.3-cp310-abi3-macosx_11_0_arm64.whl.

File metadata

  • Download URL: uromyces-0.0.3-cp310-abi3-macosx_11_0_arm64.whl
  • Upload date:
  • Size: 1.5 MB
  • Tags: CPython 3.10+, macOS 11.0+ ARM64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.9.26 {"installer":{"name":"uv","version":"0.9.26","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for uromyces-0.0.3-cp310-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 95bfa25436083b4cd45b54ed6e151a9853cf412d7e9605b83d7b917da5189c6e
MD5 3811faed22a473faecbf102818b9be65
BLAKE2b-256 c524d7694ccb4c72d2efd0fd33c4afad4ddac32631b9d44d32e0e32d3d82d407

See more details on using hashes here.

File details

Details for the file uromyces-0.0.3-cp310-abi3-macosx_10_12_x86_64.whl.

File metadata

  • Download URL: uromyces-0.0.3-cp310-abi3-macosx_10_12_x86_64.whl
  • Upload date:
  • Size: 1.5 MB
  • Tags: CPython 3.10+, macOS 10.12+ x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.9.26 {"installer":{"name":"uv","version":"0.9.26","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for uromyces-0.0.3-cp310-abi3-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 198e9726110a668f781e15b6d8b23028033e78ce77c8476fd1a2494d771aebec
MD5 14747e761666d7031429c4f06f47fb97
BLAKE2b-256 24badf6f7716ee1b2f0365a57891eebc6c7f2690a49b81463209bddb33c20c49

See more details on using hashes here.

Supported by

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