Metadata-Version: 2.4
Name: leadger
Version: 0.1.0
Summary: Personal productivity — local, calm, yours.
Author-email: Gabriel Henrique <gabrielhcacontato@gmail.com>
License: MIT
License-File: LICENSE
Keywords: cli,local-first,productivity,tasks,todo,yaml
Classifier: Development Status :: 4 - Beta
Classifier: Environment :: Console
Classifier: Environment :: Web Environment
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Python :: 3.14
Classifier: Topic :: Office/Business :: Scheduling
Requires-Python: >=3.11
Requires-Dist: fastapi>=0.111
Requires-Dist: ruamel-yaml>=0.18
Requires-Dist: typer>=0.12
Requires-Dist: tzdata>=2024.1; sys_platform == 'win32'
Requires-Dist: uvicorn[standard]>=0.29
Provides-Extra: dev
Requires-Dist: build>=1.2; extra == 'dev'
Requires-Dist: httpx>=0.27; extra == 'dev'
Requires-Dist: pytest>=8.0; extra == 'dev'
Requires-Dist: twine>=5.0; extra == 'dev'
Description-Content-Type: text/markdown

<div align="center">

# Leadger

**Personal productivity — local, calm, yours.**

[![PyPI](https://img.shields.io/pypi/v/leadger)](https://pypi.org/project/leadger/)
[![Python](https://img.shields.io/badge/python-3.11%2B-blue)](https://pypi.org/project/leadger/)
[![License: MIT](https://img.shields.io/badge/license-MIT-green)](LICENSE)

*For the important tasks that don't belong in your work's Jira.*

</div>

---

No cloud. No account. No telemetry. No gamification. Your data lives in a
single human-readable YAML file you can keep in git.

```bash
pip install leadger
leadger
```

That starts a local web UI on `localhost` and opens your browser. No Node
required — the frontend ships embedded in the package.

<!-- demo: add docs/presentation.mp4 or a screenshot here -->

## Why Leadger?

Most task apps fail the same way: red "overdue" badges that breed anxiety,
metrics you can game by deleting tasks, and feature creep that turns a todo
list into a project-management chore. Leadger takes the opposite bet —
**statistical honesty about yourself, calmly delivered**:

- **Frozen daily goal.** The first time you open Leadger each day, it
  snapshots your planned tasks: that's your goal. Tasks created during the
  day count as *extras* — they add to your delivery but never inflate the
  goal. Cancelling or deleting a planned task doesn't shrink the goal
  either (anti-gaming, by design).
- **"% of the day delivered."** The hero metric. It can pass 100%
  (over-delivery gets a second amber lap on the ring). Zero goal with
  deliveries = bonus day (∞).
- **Honest rollover.** Whatever you don't finish migrates to the next day
  automatically, with a visible `↻N` counter. History surfaces your most
  pushed tasks — procrastination becomes visible, without judgment.
- **Personal correction factor.** *"You plan 5.8 tasks/day on average and
  deliver 5.2 — your real rate is 90%."* Just statistics over your last 30
  days, so you can plan like the person you actually are.
- **Week at a glance.** The Week view shows each day's % (Mon→Sun strip),
  the week's aggregate on the ring, and the list split into *not done* /
  *done*.
- **Stale-task alert.** A task open for 7+ days triggers a one-time,
  dismissable notice: complete, reschedule, pause or cancel — deciding is
  progress too.
- **Markdown summary.** One palette action copies the period's
  goal/delivered/% plus both task lists — ready to paste into a standup.

## Quick capture

An always-visible input with live syntax highlighting:

```
Estudar FAISS #estudo !amanha
Entregar relatório #trabalho !sex
Pagar contas !2026-07-01
Meditar !todo-dia
Review da semana #trabalho !rec:seg
```

| Token | Meaning |
|---|---|
| `#tag` | add a tag (click a tag in the list to filter by it) |
| `!hoje` / `!amanha` | target today / tomorrow |
| `!seg`…`!dom` | target the next matching weekday |
| `!YYYY-MM-DD` | target an exact date |
| `!todo-dia` | recurring: every day |
| `!rec:dia` / `!rec:seg`…`!rec:dom` | recurring: daily / weekly on that weekday |

> Capture tokens are Portuguese — Leadger is a PT-first product; the UI
> ships in Portuguese and English (toggle in the header).

**Recurring tasks** are materialized one occurrence at a time: completing
the open occurrence creates the next; cancelling or deleting it ends the
series. The daily goal stays honest — each occurrence counts as a regular
task on its day.

## Keyboard first (mouse welcome)

| Key | Action |
|---|---|
| `n` | focus capture |
| `j` / `k` | navigate the list |
| `x` / `p` / `c` | complete · pause · cancel |
| `e` | inline edit (double-click works too) |
| `1`–`6` | period: Day · Week · Month · Quarter · Half · Year |
| `⌘K` / `Ctrl+K` | command palette |
| `g h` / `g t` | History · Today |
| `?` | cheatsheet |

Every keyboard action also has a visual control — hover a task row for
edit/pause/cancel/delete buttons, each tooltip teaching its shortcut.

## CLI

```bash
leadger                       # start the server and open the browser
leadger serve --port 8080 --no-browser
leadger add "Estudar FAISS #estudo !amanha"
leadger today                 # today's summary in the terminal
leadger week                  # weekly summary: % per day + (not) done
leadger ics --out agenda.ics  # export open tasks as iCalendar
leadger --data other.yaml …   # use another data file
```

## Calendar (.ics)

See your open tasks in any calendar app, without a cloud:
`leadger ics --out leadger.ics` writes the file, and with the server
running, `http://localhost:4242/calendar.ics` serves the same content.
Recurring tasks become `RRULE`s, so the whole series shows up projected on
your calendar. The export is read-only — the YAML remains the single
source of truth.

## Your data

Everything lives in `~/.leadger/leadger.yaml` — a commented, readable,
versionable YAML file. Leadger preserves your comments and key order on
every write (round-trip), writes atomically and keeps a `.bak` of the
previous version. Edit it in any editor; the app detects the change and
reloads.

```yaml
tasks:
  - id: t_8f3k2a
    title: Revisar pipeline de segmentação
    status: todo            # todo | done | paused | cancelled
    target: 2026-06-09
    tags: [trabalho]
    migrations: 0           # times pushed to the next day
    recur: seg              # optional: dia | seg..dom (recurring task)
```

## What Leadger deliberately doesn't do

Sync, cloud, accounts, subtasks, pomodoro, XP, badges, confetti,
databases. The YAML is the single source of truth.

## Development

See `CONTEXT.md` for the full contract (schema, business rules, phases).

```bash
pip install -e ".[dev]"
pytest
```

### Frontend (React + Vite + Tailwind)

```bash
cd frontend
npm install
npm run dev      # hot reload; proxies /api to the backend on 4242
npm run build    # outputs frontend/dist
```

For development, run the backend with `leadger serve --port 4242
--no-browser` and Vite with `npm run dev`.

### Release

```bash
make dist        # frontend build + embed into src/leadger/static + python -m build
twine upload dist/*
```

Without `make` (PowerShell): `npm run build` in `frontend/`, copy
`frontend/dist/*` into `src/leadger/static/`, then `python -m build`.

## License

[MIT](LICENSE)
