Skip to main content

Document verification plugin for Beancount

Project description

Beancount Docverif Build Status

Docverif is the "Document Verification" plugin for beancount, fulfilling the following functions:

  1. Require that every transaction touching an account have an accompanying document on disk:

    2000-01-01  open  Expenses:General BEAN
      docverif: "Require"
    
  2. Explicitly declare the name of a document accompanying a transaction:

    ; Document entry pointing to a working document: should validate correctly
    2020-06-01  *   "plumber"   "fix faucet leak"
      document: "2020-06-01.plumber - services.pdf"
      Expenses:General
      Assets:Bank -150 BEAN
    
  3. Explicitly declare that a transaction is expected not to have an accompanying document:

    ; Explicit "None" document: should ignore missing document
    2020-06-01  *   "store" "groceries"
      document: "None"
      Expenses:General
      Assets:Bank -10 BEAN
    
  4. Look for an "implicit" PDF document matching transaction data:

    ; Document entry without an explicit "document" entry,
    ; should implicitly match document: "2020-06-01.plumber - services.pdf"
    2020-06-01  *   "plumber"   "services"
      Expenses:General
      Assets:Bank -150 BEAN
    
  5. Associate (and require) a document with any type of entry, including open entries themselves:

    2000-01-01  open    Assets:Bank BEAN
      docverif: "Require"
      document: "2020-06-01.plumber - services.pdf"
    
  6. Guarantee integrity: verify that every document declared does in fact exist on disk.

Installation

pip install beancount_docverif

Usage

In your toplevel .beancount file, include:

plugin  "beancount_docverif"
option  "documents" "./"

See the .beancount files in test for examples.

Developing

Install package and dev requirements locally:

python3 -m pip install -e .[dev]

Run tests:

python3 -m pytest

Build both binary and source distributions locally:

python3 setup.py bdist_wheel sdist

See sanitize.sh for maintainer's personal tooling.

Beancount Quirks

  1. We depend on beancount itself finding documents and auto-generating Document entries. This requires a documents option in the beancount file itself, eg:

    option "documents" "./"
    
  2. Subdirectory format TODO

  3. Fictitious TODO

  4. Filename must be valid (eg. "broken.pdf" is out)

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

beancount_docverif-1.0.1.tar.gz (25.4 kB view hashes)

Uploaded Source

Built Distribution

beancount_docverif-1.0.1-py3-none-any.whl (4.7 kB view hashes)

Uploaded Python 3

Supported by

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