Version0.10.2Verifiednot yet verifiedLicenseBSD-3-Clause
Readme
sigil-ledger
A Sigil library for reading, writing, and querying hledger journal files. Build financial automation tools that work with plain-text accounting.
Features
- Journal parsing — read hledger journal files into structured records (transactions, postings, amounts, commodities, tags)
- Journal writing — write and append transactions in valid hledger format
- Multi-currency — full support for cost notation (
@and@@) and balance assertions - Deduplication — filter out already-imported transactions by reference ID tag
- Report generation — run hledger CLI commands (balance, register, income statement) and parse output
- Round-trip fidelity — parse and re-serialize journals without losing information
Usage
(import (ledger))
;; Parse a journal file
(define txns (read-journal "/path/to/finances.journal"))
;; Create a new transaction
(define txn (journal-transaction
date: "2026-03-25"
status: "*"
description: "Coffee Shop"
postings: (list
(journal-posting
account: "expenses:food:coffee"
amount: (journal-amount quantity: 4.50 commodity: "EUR"))
(journal-posting
account: "assets:wise:eur"))))
;; Append new transactions to journal
(append-transactions "/path/to/finances.journal" (list txn))Reports via hledger CLI
(import (ledger report))
;; Run a balance report
(hledger-balance "/path/to/finances.journal" "assets" tree: #t)
;; Income statement for a period
(hledger-income-statement "/path/to/finances.journal" period: "2026-03")Read the rest
Journal Format Support
Handles standard hledger journal syntax:
- Dates, status flags (
*,!), transaction codes - Payee/note separator (
|) - Account names with amounts and commodities
- Inline and line comments (
;) - Tags in comments (
tag:value) - Cost notation (
@ PRICEand@@ TOTAL) - Balance assertions (
= AMOUNT,== AMOUNT,=* AMOUNT)
Known Limitations
- European number format — amounts using period as thousands separator and comma as decimal separator (e.g.
1.000,50 EUR) are not supported. Use US-style formatting (1,000.50 EUR) or omit thousands separators. This matches the most common hledger usage; fulldecimal-markdirective support may be added in a future release.
Dependencies
- sigil-stdlib
- sigil-json (for hledger JSON output parsing)
Requires hledger on PATH for report generation features.
Building
sigil deps install
sigil build
sigil testLicense
BSD-3-Clause
Clone
$ git clone https://codeberg.org/sigil/sigil-ledger
Releases
v0.10.2 — latest by version, released 14 Jul 2026
All releases — 5 tags in this repository.
Source
One page per file, and every line has a permalink.
Recent commitsAtom
14 Julcommit
28 Juncommit
26 Aprcommit
1 Aprcommit
29 Marcommit
Pin dependencies to version tags
2464d344
25 Marcommit
25 Marcommit
25 Marcommit
25 Marcommit
959a593e
25 Marcommit
25 Marcommit
e87cc237
25 Marcommit
64e0b082
The last 20 commits keep a page here. Everything older lives in the clone.