Skip to main content

beancount-nblock

A collection of beancount plugins.

unlinked_documents: find missing links between documents and transactions

It might be desireable to enforce a link between certain kind of documents and a corresponding transaction. Typical use cases are incoming and outgoing invoices where a receipt (referenced via a document directive) should have a matching transaction.

The following is valid, according to this plugin:

2019-01-01 * "Payee" "A description" ^ER-some-id
  Assets:Bank:Checking     300.00 EUR
  Expenses:Home

2019-01-01 document Assets:Bank:Checking "/path/to/receipt.pdf" ^ER-some-id

An error is generated in case either of the above directives is missing.

Usage

Add the following to your beancount file:

plugin "beancount_nblock.unlinked_documents"

The default list of patterns is: AR-*, ER-*. A custom list of patterns may be configured via:

plugin "beancount_nblock.unlinked_documents" "PATTERN-FOO-*,PATTERN-BAR-*

repel: avoid specific combinations of tags and accounts in a single transaction

Check for combinations of tag and account names and raise an error in case they occur together in a transaction.

Consider the tag/account pair (FOO, Assets:Checking) where FOO is a tag and Assets:Checking is an account name. The following transaction is flagged by the plugin:

2019-01-01 * "Payee" "A description" #FOO
  Assets:Checking     300.00 EUR
  Expenses:Home

Usage

Add the following to your beancount file:

plugin "beancount_nblock.repel" "PLUGIN CONFIGURATION"

where PLUGIN CONFIGURATION is a list of tag/account tuples such as "[('FOO', 'Assets:Checking')]". The tag FOO should not occur in the same transaction as the account Assets:Checking.

file_ordering: enforces strict date ordering within individual Beancount files

This Beancount plugin validates that each Beancount file that contains 2 or more transactions is strictly chronologically ordered. I.e., no transaction that occurs later in a given file (in file order) has a date that occurs earlier (in calendar order) than a previous transaction in the same file.

While Beancount by default doesn't care about file ordering of directives, ensuring in-file date ordering on transaction is a useful check to avoid certain kinds of booking errors, e.g., copy-pasting an old transaction, forgetting to bump its date.

This plugin was developed by Stefano Zacchiroli and released under GNU General Public License (GPL), version 2 or above. It was incorporated into this repository from https://github.com/zacchiro/beancount-plugins-zack at commit a86a50bbd7fcc6e202db35dce3ca3af0a504493c to simplify distribution and installation via pip.

Usage

Add the following to your beancount file:

plugin "beancount_nblock.file_ordering"

Metadata

Release files for beancount-nblock 0.2.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for beancount-nblock 0.2.1
File Size Uploaded
beancount_nblock-0.2.1.tar.gz 13.5 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for beancount-nblock 0.2.1
File Interpreter ABI Platform
beancount_nblock-0.2.1-py3-none-any.whl Python 3 none any Details

Total release size: 25.9 kB

Release files / beancount_nblock-0.2.1.tar.gz

Download URL beancount_nblock-0.2.1.tar.gz
Size 13.5 kB
Tags Source
SHA-256 checksum
How to use checksums
35e60703ed69d6a5d4b83eb46fe299987c8c34d560132dc31912c7600475b579
BLAKE2b-256 checksum
How to use checksums
b1ed38464dbac6a86d8c28a78de2d80c24fcb11629bea2b8f5721ff774c6a6c4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.4

Release files / beancount_nblock-0.2.1-py3-none-any.whl

Download URL beancount_nblock-0.2.1-py3-none-any.whl
Size 12.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
0340b6a7ad98c73ff08a079bb5cf342a66a97015878f5867a497395f3a0655fb
BLAKE2b-256 checksum
How to use checksums
55cfe892639364a713c4e810012de346d626efcc2d91ea40719d5b9210e4a219
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.4

Release history Release notifications | RSS feed

This release

0.2.1 This release

2 release files

0.2.0

2 release files

0.1.0

2 release files

0.0.2

2 release files

0.0.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page