Skip to main content

Translate Ledger CLI query syntax into BQL

Project description

ledger2bql

Translate Ledger CLI query syntax into BQL

Implemented in Python.

The package is available at https://pypi.org/project/ledger2bql/.

Introduction

BQL is quite a powerful language for slicing and dicing Beancount data. But, when all you need are simple queries, writing every field and filter seems tedios. In comparison, Ledger CLI's syntax is short and efficient. A simple l b bank will list all bank accounts, assuming a well-organized account tree.

The purpose of this project, a simple CLI utility, is to accept a Ledger-like syntax, generate an appropriate BQL statement, and run it for you.

Development

Setup

Add an .env file, specifying the BEANCOUNT_FILE location.

BEANCOUNT_FILE=tests/sample_ledger.bean
uv sync

Build

uv build

Run

uv run ledger2bql

or run

l ...

Usage

Set the BEANCOUNT_FILE variable to point to your Beancount ledger file.

Run

ledger2bql b card
ledger2bql r card -b 2025-08-01

To get the list of available parameters, simply run

ledger2bql
ledger2bql bal --help
ledger2bql reg --help

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

ledger2bql-0.4.5.tar.gz (19.4 kB view details)

Uploaded Source

Built Distribution

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

ledger2bql-0.4.5-py3-none-any.whl (20.4 kB view details)

Uploaded Python 3

File details

Details for the file ledger2bql-0.4.5.tar.gz.

File metadata

  • Download URL: ledger2bql-0.4.5.tar.gz
  • Upload date:
  • Size: 19.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.8.14

File hashes

Hashes for ledger2bql-0.4.5.tar.gz
Algorithm Hash digest
SHA256 4b3578f7c56981cd7c695a98c0a52610d7d34ab37c40711a30c8f5684cb06389
MD5 5ceb2e5006e5fa33beb54d78a64ace52
BLAKE2b-256 d7ad64e0587c814ad0ec560facb8777ebc43ea62aac0a0aa7fa712f23e379c95

See more details on using hashes here.

File details

Details for the file ledger2bql-0.4.5-py3-none-any.whl.

File metadata

  • Download URL: ledger2bql-0.4.5-py3-none-any.whl
  • Upload date:
  • Size: 20.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.8.14

File hashes

Hashes for ledger2bql-0.4.5-py3-none-any.whl
Algorithm Hash digest
SHA256 a481f050af2e0f6b3c75fcc587cf57233670af0af81141b691121da24011aa1d
MD5 0efcd0e384b66c42b57451fecc703a91
BLAKE2b-256 6b2c2e585cde5e0cfa31279d9a3d4b891c9b485f13f7107262a0dc41b7c88beb

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