1
0
Fork
You've already forked hledger-panel
0
Panel dashboard for Hledger
  • JavaScript 74.3%
  • Python 23.1%
  • HTML 2.4%
  • CSS 0.2%
Faiz Jazadi b60b688f04
Initial commit: hledger-panel financial dashboard
- Interactive financial analytics dashboard using Panel (HoloViz)
- Wraps hledger CLI with Python API, outputs Pandas DataFrames
- Configurable settings via pydantic-settings (.env support)
- Websocket origin and host configuration via CLI or settings
- Includes balance sheet, income/expenses, cashflow, fuel/travel views
2026年03月17日 23:10:28 +07:00
hledger_panel Initial commit: hledger-panel financial dashboard 2026年03月17日 23:10:28 +07:00
tests Initial commit: hledger-panel financial dashboard 2026年03月17日 23:10:28 +07:00
.env.example Initial commit: hledger-panel financial dashboard 2026年03月17日 23:10:28 +07:00
.gitignore Initial commit: hledger-panel financial dashboard 2026年03月17日 23:10:28 +07:00
AGENTS.md Initial commit: hledger-panel financial dashboard 2026年03月17日 23:10:28 +07:00
pyproject.toml Initial commit: hledger-panel financial dashboard 2026年03月17日 23:10:28 +07:00
README.md Initial commit: hledger-panel financial dashboard 2026年03月17日 23:10:28 +07:00
uv.lock Initial commit: hledger-panel financial dashboard 2026年03月17日 23:10:28 +07:00

hledger-panel

Interactive financial dashboard for hledger, a command-line accounting tool.

Features

  • Balance Sheet: Historical account balances over time
  • Cashflow: Balance changes across accounts
  • Income vs. Expenses: Periodic income and expense analysis
  • Extensible: Easy to add new dashboard modules
  • Responsive: Works on desktop and mobile

Installation

cd /path/to/personal-hledger
uv sync
uv run hledger-panel serve

With pip

cd /path/to/personal-hledger
pip install -e .
hledger-panel serve

Quick Start

  1. Set your ledger file (in .mise.toml or shell):

    export LEDGER_FILE=/path/to/ledger
    
  2. Start the dashboard:

    hledger-panel serve
    # or: python -m hledger_panel.dashboard.serve
    
  3. Open your browser to http://localhost:5006

Development

Setup

uv sync

Run dashboard

uv run hledger-panel serve

Lint code

uv run ruff check .
uv run ruff format .

Run tests

uv run pytest

Project Structure

hledger_panel/
├── cli/ # CLI entry point
├── core/ # Core ledger API
├── common/ # Shared utilities (widgets, transforms, plots)
├── dashboard/ # Web dashboard (serve, views, template)
└── __init__.py # Package metadata
tests/ # Test suite

Adding New Dashboard Views

  1. Create a new file in hledger_panel/dashboard/views/
  2. Export required variables:
    • content: Panel object or callable
    • name: (optional) Display name
    • description: (optional) Short description

Example:

import shlex
import panel as pn
import hvplot.pandas # noqa: F401
from hledger_panel.core.ledger import HledgerAPI
from hledger_panel.common.widgets import create_query_widget, create_settings_panel
from hledger_panel.common.plots import create_step_plot, wrap_holoviews
from hledger_panel.common.transforms import pivot_balance
name = "My View"
description = "My custom dashboard"
hl = HledgerAPI.from_env()
hlx = pn.rx(hl)
query = create_query_widget()
settings = create_settings_panel(query)
dfx = hlx.balance(query.rx.pipe(lambda q: shlex.split(q)))
pdfx = dfx.pipe(pivot_balance)
plot = create_step_plot(pdfx, x="start_date")
content = pn.Column(settings, wrap_holoviews(plot))

Configuration

Set via environment or .mise.toml:

  • LEDGER_FILE: Path to hledger ledger file (required)

License

MIT