$ show hledgerorg/hledger
hledger is a cross-platform plain text accounting application that provides three user interfaces: a command-line tool (hledger), a terminal UI (hledger-ui), and a web UI (hledger-web). It implements double-entry bookkeeping with support for multiple currencies, investment lot tracking, budgeting, forecasting, and CSV import. Users maintain their financial data in human-readable journal files, and hledger generates reports such as balance sheets, income statements, cash flow, and transaction registers. The project is structured as a Haskell monolith with four packages: hledger-lib (core library for parsing, data models, reporting, and output), hledger (CLI with 30+ commands), hledger-ui (terminal interface using brick/vty), and hledger-web (web interface using Yesod). The core library handles reading multiple input formats (journal, CSV, timedot, timeclock), applying queries and filters, and writing reports in text, CSV, JSON, HTML, and ODS formats. The CSV import system uses a declarative rules engine for mapping external data to journal entries. The codebase demonstrates high craftsmanship with clean abstractions, extensive test coverage (unit tests, shell tests, browser-based Playwright tests), and active maintenance with CI/CD across Linux, macOS, and Windows. It has comprehensive documentation, internationalization support, and a well-defined contribution process. While the project has some technical drift (vendored old web dependencies, multiple build systems), it remains a robust and well-engineered application with several reusable components that could be extracted for other projects.
The LLM identified 4 files worth highlighting for reuse:
Provides a comprehensive mapping of currency symbols to ISO 4217 codes and a snapshot of top cryptocurrencies. Includes normalization functions (toCurrencyCode, currencySymbolToCode, currencyCodeToSymbol) that can be reused in any financial application requiring currency code standardization. The module is self-contained with no internal hledger dependencies.
Implements a generic table model with Cell types (Text, Number, Date, etc.), Style (alignment, formatting), Border, and Span. Used by HTML and ODS writers but completely independent of hledger's domain. Could be extracted as a standalone library for generating tabular output in any application.
A format string parser that supports custom report layouts with field specifiers like %-(account), %20(total), etc. This mini-template language allows users to define custom output formats. The parser is self-contained and could be reused in any application needing configurable string formatting.
A data structure for period-based data with historical and per-period components, implementing Foldable and Traversable typeclasses. This is a general-purpose pattern for time series or period-based aggregation that could be extracted for use in analytics or reporting applications.