Metadata-Version: 2.4
Name: ledgerkit-editor
Version: 1.0.1
Summary: A keyboard-driven terminal editor for hledger plain-text accounting journals
Author: Cormac O'Sullivan
License: MIT
Project-URL: Homepage, https://github.com/ctosullivan/ledgerkit-editor
Project-URL: Bug Tracker, https://github.com/ctosullivan/ledgerkit-editor/issues
Project-URL: Changelog, https://github.com/ctosullivan/ledgerkit-editor/blob/master/CHANGELOG.md
Keywords: hledger,ledger,accounting,tui,textual,plaintext-accounting
Classifier: Development Status :: 4 - Beta
Classifier: Environment :: Console
Classifier: Intended Audience :: End Users/Desktop
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Topic :: Office/Business :: Financial :: Accounting
Requires-Python: >=3.9
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: textual==8.2.5
Requires-Dist: ledgerkit==1.0.0.dev1
Provides-Extra: dev
Requires-Dist: pytest; extra == "dev"
Requires-Dist: pytest-asyncio; extra == "dev"
Dynamic: license-file

# ledgerkit-editor

[![CI](https://github.com/ctosullivan/ledgerkit-editor/actions/workflows/ci.yml/badge.svg)](https://github.com/ctosullivan/ledgerkit-editor/actions/workflows/ci.yml)

A keyboard-driven terminal editor for hledger plain-text accounting journals.

> **Early beta — use with caution.** This software is under active development and
> **may corrupt your journal files**. Always keep a backup before editing. Do not
> use on irreplaceable data without a recovery plan.

Built with [Textual](https://textual.textualize.io/) and
[ledgerkit](https://github.com/ctosullivan/ledgerkit).

---

## Features

- Full-screen text editor with hledger syntax highlighting (dates, payees, accounts,
  amounts, commodities, comments, directives)
- Monokai Pro default theme; runtime theme switching supported
- Incremental search with match highlighting (`Ctrl+F`, `Shift+PgUp/Down`)
- View filter — show all / cleared-only / unreconciled-only transactions (`Ctrl+L`)
- Transaction block selection and duplication (`Ctrl+T`, `Ctrl+G`)
- Cleared status toggle — single transaction (3-state cycle) and bulk selection (`Ctrl+R`)
- Insert today's date at cursor (`Ctrl+D`)
- Date shifting with `Shift+Up` / `Shift+Down` (cursor-position-aware)
- Save with date-sort and whitespace re-alignment (`Ctrl+S`)
- Undo / Redo (`Ctrl+Z` / `Ctrl+Y`)
- Command palette (`Ctrl+P`)

### Planned / In Progress

- Transaction filter popup (`Ctrl+O`) — UI stub only; criteria filtering not yet implemented
- BalanceSidebar — account balance tree (wired up, threaded refresh on save)
- RegisterPanel — account transaction register (wired up, last 500 rows)
- Reconciliation mode

---

## Installation

### From PyPI

```bash
pip install ledgerkit-editor
ledgerkit-editor path/to/my.journal
```

### Development setup

```bash
git clone https://github.com/ctosullivan/ledgerkit-editor.git
cd ledgerkit-editor

python -m venv .venv
.venv\Scripts\activate        # Windows
# source .venv/bin/activate   # macOS / Linux

pip install --upgrade pip
pip install -e ".[dev]"

# Run tests
pytest --tb=short

# Launch
ledgerkit-editor path/to/my.journal
```

---

## Journal File Resolution

The editor resolves the journal file in this order:

1. Path passed as a command-line argument
2. `$LEDGER_FILE` environment variable
3. `~/.hledger.journal` default
4. Interactive prompt on launch (if none of the above resolve)

---

## Keyboard Shortcuts

See [docs/shortcuts.md](docs/shortcuts.md) for the full reference.

---

## Requirements

- Python 3.9+
- textual 8.2.5
- ledgerkit 1.0.0.dev1

---

## Development

See [CONTRIBUTING.md](CONTRIBUTING.md) for setup instructions and the
ledgerkit dependency update workflow.

## Roadmap

See [ROADMAP.md](ROADMAP.md) for planned features and current development status.

---

> This repository was previously named `PyLedger-editor`. GitHub redirects
> old URLs automatically.
