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.4.tar.gz (274.3 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.4-cp310-abi3-win_arm64.whl (1.2 MB view details)

Uploaded CPython 3.10+Windows ARM64

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

Uploaded CPython 3.10+Windows x86-64

uromyces-0.0.4-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.4-cp310-abi3-manylinux_2_28_aarch64.whl (1.6 MB view details)

Uploaded CPython 3.10+manylinux: glibc 2.28+ ARM64

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

Uploaded CPython 3.10+macOS 11.0+ ARM64

uromyces-0.0.4-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.4.tar.gz.

File metadata

  • Download URL: uromyces-0.0.4.tar.gz
  • Upload date:
  • Size: 274.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.10.4 {"installer":{"name":"uv","version":"0.10.4","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.4.tar.gz
Algorithm Hash digest
SHA256 78610c7d427081de623af127e663034b65a6c3748def1b118e29a4425339621e
MD5 58518d2736d904c4863d6a46b5054d39
BLAKE2b-256 7f67431424a36b88b598a1f6ca48f5e313bafe3e3a00cb5141d7d8b37b5d4fae

See more details on using hashes here.

File details

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

File metadata

  • Download URL: uromyces-0.0.4-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.10.4 {"installer":{"name":"uv","version":"0.10.4","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.4-cp310-abi3-win_arm64.whl
Algorithm Hash digest
SHA256 e35ad620f6af985e8a3b69ee7e33702793a9377343b7b397977d260964f13892
MD5 0664802510b964bed6e4a7f2b805751e
BLAKE2b-256 64f3c0f8b143b2f1e3462e65e822a8b359966a9061a16b6b18cdfc267cdcbf6d

See more details on using hashes here.

File details

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

File metadata

  • Download URL: uromyces-0.0.4-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.10.4 {"installer":{"name":"uv","version":"0.10.4","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.4-cp310-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 626b78fdd8200bb3ab7fb51a6bbdf656f973ee7fed4d6e4dfc0dc505cb0d85c3
MD5 fe7f916a4492d2b69dfabb24ed0709a1
BLAKE2b-256 27436420a71aab5473c1175f0c9dad47a869959c866315d135bfa938d127a60f

See more details on using hashes here.

File details

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

File metadata

  • Download URL: uromyces-0.0.4-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.10.4 {"installer":{"name":"uv","version":"0.10.4","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.4-cp310-abi3-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 0ecc4e07b8a7cec2ab328022a30e47ddf3b82bcc9879decbeed84e3bfd931230
MD5 1d9ca40188284dc8235b1f66c49a0f6c
BLAKE2b-256 23163b40db3489d183787cc38118453bab4047c46bf3b61d19e3d7e79a458713

See more details on using hashes here.

File details

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

File metadata

  • Download URL: uromyces-0.0.4-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.10.4 {"installer":{"name":"uv","version":"0.10.4","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.4-cp310-abi3-manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 87b48c2aada6ac42c0c9d5ff18f7ee42501453544b7186e2df8560ab701c9146
MD5 31bd7711231067c170e4a1bfe9984ff7
BLAKE2b-256 91e18d6d617fb7198e0bd35b60b61be631abe9d87cfea11e87cfd75448d25a38

See more details on using hashes here.

File details

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

File metadata

  • Download URL: uromyces-0.0.4-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.10.4 {"installer":{"name":"uv","version":"0.10.4","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.4-cp310-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 4a617673d69145687a53237bc6f1425b5a6250c88149cf90aeff4f06547a6001
MD5 b1500442fd3143d53a63abedfbb52b91
BLAKE2b-256 74b535db7ae6b56f86d2bb22a91facbf6866349ab5bc409757b3025d03f0f2c8

See more details on using hashes here.

File details

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

File metadata

  • Download URL: uromyces-0.0.4-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.10.4 {"installer":{"name":"uv","version":"0.10.4","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.4-cp310-abi3-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 d08ffffcba59ca9878e81a85f9476ebe532175d93648d0970273cc79caf66c9c
MD5 6bea49543ff7caab810e5dd7a4bf650a
BLAKE2b-256 9d7160c1ec85143733644fee15d292fff7dee4cefa3c79d48674edfc04788796

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