Skip to main content

Add your description here

Project description

ledger2bql

Translate Ledger CLI query syntax into BQL

Implemented in Python.

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.2.tar.gz (19.0 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.2-py3-none-any.whl (20.0 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for ledger2bql-0.4.2.tar.gz
Algorithm Hash digest
SHA256 b91ddaee8c356cebb17de823d501ca9f7da698ece5c24dbe22f86bf2deb1c49e
MD5 25837ec09242a4c6ba242070b1bbea93
BLAKE2b-256 96b1ecfc38e863176a4973d71c6c2779dd4a5629cd481bbf315580d9711f1c17

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for ledger2bql-0.4.2-py3-none-any.whl
Algorithm Hash digest
SHA256 906aba340ad924c38398def19f0b9eeb43833775f5ab89690641aae566b8a118
MD5 f62a7083117c1ef9735b02859f44b517
BLAKE2b-256 8cbc952da5c489941850205f5ee9ca5f10cc4396064d7a77c2e7e4f2dd34f9d7

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