Skip to main content

No project description provided

Project description

Beancount INquiry

A CLI tool to INject parameters into Beancount queries specified in your ledger

Usage

Beancount INquiry will inject parameters into query directives specified in your ledger file using pythons .format function, and so uses the same syntax. Here is an example query directive with two parameters:

2025-01-01 query "balance" "SELECT date, account, sum(number) as total WHERE account ~ '{}' AND date >= {} ORDER BY account"

And then pass in the ledger, the name of the query, and the list of parameters

bean-inquiry ledger.beancount balance Assets 2014-05-01

You can also use indexed placeholders:

2025-01-01 query "balance" "SELECT date, {0}, sum(number) as total WHERE {0} ~ '{1}' AND date >= {2} ORDER BY {0}"
...
bean-inquiry ledger.beancount balance account Assets:Bank 2025-05-01

And named placeholders, with parameter keys separated with a colon:

2025-01-01 query "balance" "SELECT date, {select}, sum(number) as total WHERE {select} ~ '{account}' AND date >= {date} ORDER BY {select}"
...
bean-inquiry ledger.beancount balance select:account account:Assets:Bank date:2025-05-01

See the --help for more options

bean-inquiry --help

Installation

Pipx (recommended)

Install using pipx from PyPi

pipx install bean-inquiry
bean-inquiry --help

Build from source using pipx

Clone this repository and install systemwide using pipx:

git clone https://github.com/aleyoscar/beancount-inquiry.git
cd beancount-inquiry
pipx install .
bean-inquiry --help

Run using poetry

Clone this repository and run using poetry

git clone https://github.com/aleyoscar/beancount-inquiry.git
cd beancount-inquiry
poetry install
poetry run bean-inquiry

Dependencies

This project uses typer for the CLI and beanquery for running the queries

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

bean_inquiry-0.2.1.tar.gz (3.9 kB view details)

Uploaded Source

Built Distribution

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

bean_inquiry-0.2.1-py3-none-any.whl (5.2 kB view details)

Uploaded Python 3

File details

Details for the file bean_inquiry-0.2.1.tar.gz.

File metadata

  • Download URL: bean_inquiry-0.2.1.tar.gz
  • Upload date:
  • Size: 3.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.2.0 CPython/3.11.9 Windows/10

File hashes

Hashes for bean_inquiry-0.2.1.tar.gz
Algorithm Hash digest
SHA256 16406673c6bcbfe3671e3d546dcf77dadacca19804d17c15e1a8c9d1ba5a195b
MD5 0c7e59ab73d2a8222c422c0259da3284
BLAKE2b-256 78f43dbb8f8af85358bb19d723e198e826972115bbed0442437cddec001992d8

See more details on using hashes here.

File details

Details for the file bean_inquiry-0.2.1-py3-none-any.whl.

File metadata

  • Download URL: bean_inquiry-0.2.1-py3-none-any.whl
  • Upload date:
  • Size: 5.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.2.0 CPython/3.11.9 Windows/10

File hashes

Hashes for bean_inquiry-0.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 b0b0546bec842ba880691628ed22e8ab0414e266110bac85db83d0c1df915e73
MD5 8d1ef5aea1ddfb43cedf219ccfc5a0e9
BLAKE2b-256 f336cde331c5b53470ad533631d1da52e0c1ba661db96f58fab2df1a3728a405

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