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

Uploaded CPython 3.10+Windows ARM64

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

Uploaded CPython 3.10+Windows x86-64

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

Uploaded CPython 3.10+manylinux: glibc 2.28+ ARM64

uromyces-0.0.2-cp310-abi3-macosx_11_0_arm64.whl (1.4 MB view details)

Uploaded CPython 3.10+macOS 11.0+ ARM64

uromyces-0.0.2-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.2.tar.gz.

File metadata

  • Download URL: uromyces-0.0.2.tar.gz
  • Upload date:
  • Size: 264.2 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.2.tar.gz
Algorithm Hash digest
SHA256 c2746cc7c1fa2a9abeb4c2730dc4cea6cd5197c831f8c55def0de0b64178926c
MD5 38c7550f8a9955f5ec1775c579e6394c
BLAKE2b-256 f276214fddc6c5b0466fb56df1e7971c6fd01e40cb6d5dcf8f30d0c2667c9ccb

See more details on using hashes here.

File details

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

File metadata

  • Download URL: uromyces-0.0.2-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.2-cp310-abi3-win_arm64.whl
Algorithm Hash digest
SHA256 b11b001fd5e7382ab20b4ad68aa546cd9e30a883dd3d04a931675a9c90d1b010
MD5 accbb0174693a334a8031eac68562519
BLAKE2b-256 fbe07515da8dd7300fa4ff29187005cf8c9be4f81222bb7d7231f1b767a955ac

See more details on using hashes here.

File details

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

File metadata

  • Download URL: uromyces-0.0.2-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.2-cp310-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 8b10e544c4a331c574673693329ba7ee021f4a4979c877940066cdfadc2ab4ff
MD5 de052d47cec1eba2c8d6bb69a1f97808
BLAKE2b-256 7ae8aa1ba662b3d47cc3b1da4f7a809d8d2df1a2b5a26134d2c4885dde1e8516

See more details on using hashes here.

File details

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

File metadata

  • Download URL: uromyces-0.0.2-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.2-cp310-abi3-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 d695e60103eaf7cace693204a47ab32d1a064b9bbfb9ba2665d1cf478333c3a3
MD5 0f0f9f1ff66cca51a18319dc8dfac24b
BLAKE2b-256 cdaeda7add202d8abfffb0de0f96682e441afdd662f07ec5731689d489702691

See more details on using hashes here.

File details

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

File metadata

  • Download URL: uromyces-0.0.2-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.2-cp310-abi3-manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 baa0b43f3dde7752f3fd4113f1a899235af49a618ec455e721c81fa86c9ee876
MD5 2089b9c8d80ed0eb580fe5cc57a1e65e
BLAKE2b-256 2839897b45a23f69fce97f79789426c99d92ad31350eeb2d5c7b41f5c03c0f54

See more details on using hashes here.

File details

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

File metadata

  • Download URL: uromyces-0.0.2-cp310-abi3-macosx_11_0_arm64.whl
  • Upload date:
  • Size: 1.4 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.2-cp310-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 3db57f946e49296472e2c4044eae2130e16628ab692dcc1989a2632383c8fa93
MD5 6a50ac2ac36fb7df5248b935a67a1b6a
BLAKE2b-256 3e75e3f1ee107305eb2859e9df3238eb7c1c9aaa6fd5c4021f94f2aff1b3b6cf

See more details on using hashes here.

File details

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

File metadata

  • Download URL: uromyces-0.0.2-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.2-cp310-abi3-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 9b8a6ca8726e5bbfaea538ec6807980479cd9a52332b26ff14d23915d246c80c
MD5 dbab3f3750bd78b5cd644299095f73a8
BLAKE2b-256 ab08f43ddfb06cea2dd0236969d38bba1defa428a72ea21205a460571e33e1dd

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