Metadata-Version: 2.3
Name: rainlog
Version: 1.0.0
Summary: A collection of CLI tools to record weather related data
Author: marvin8
Author-email: marvin8 <marvin8@tuta.io>
License: AGPL-3.0-or-later
Requires-Dist: cyclopts~=4.20.0
Requires-Dist: platformdirs~=4.10.0
Requires-Dist: rich~=15.0.0
Requires-Dist: textual~=8.2.7
Requires-Dist: typing-extensions~=4.15.0
Requires-Python: >=3.11
Project-URL: Documentation, https://marvin8.codeberg.page/rainlog/
Project-URL: Issues, https://codeberg.org/marvin8/rainlog/issues
Project-URL: Source, https://codeberg.org/marvin8/rainlog
Project-URL: Changelog, https://codeberg.org/marvin8/rainlog/src/branch/main/CHANGELOG.md
Description-Content-Type: text/markdown

# rainlog

[![PyPI version](https://img.shields.io/pypi/v/rainlog.svg)](https://pypi.org/project/rainlog/)
[![Python versions](https://img.shields.io/pypi/pyversions/rainlog.svg)](https://pypi.org/project/rainlog/)
[![License: AGPL-3.0](https://img.shields.io/badge/License-AGPL_v3-blue.svg)](https://www.gnu.org/licenses/agpl-3.0)
[![CI](https://ci.codeberg.org/api/badges/marvin8/rainlog/status.svg)](https://ci.codeberg.org/marvin8/rainlog)
[![Docs](https://img.shields.io/badge/docs-rainlog.marvin8.zone-teal)](https://rainlog.marvin8.zone)

A terminal-based rain logger. Record daily rainfall totals in a local SQLite database and explore history through an interactive TUI.

**License:** [AGPL-3.0-or-later](https://www.gnu.org/licenses/agpl-3.0.html)

**Python:** 3.11–3.14

## Install

From the repository root (with [uv](https://docs.astral.sh/uv/) recommended):

```bash
uv sync
```

Or install the package into your environment:

```bash
uv pip install .
```

The console entry point is **`rainlog`**.

## Usage

Run the TUI:

```bash
rainlog
```

| Key | Action |
|-----|--------|
| `n` | Add a rain record |
| `e` | Edit a record (use `s` to select a bar first in daily view) |
| `←` / `→` | Scroll history back / forward |
| `g` | Cycle grouping (daily / weekly / monthly / yearly) |
| `m` | Toggle chart mode (rainfall ↔ soil-moisture index) |
| `+` / `-` | More / fewer bars |
| `a` | Auto bar count |
| `q` | Quit |

## Data storage

- By default, data lives in `rainlog.sqlite` in `~/.local/share/rainlog/`.
- Use **`--db-dir`** to put the database in another directory (the filename stays `rainlog.sqlite`).
- Each row stores the **rain total in millimetres** for a 24-hour block ending at **09:00** local time on the given calendar day.

## Development

Tests and automation are driven by **Nox**; list sessions with `nox -l` and run the ones you need (e.g. tests).

## Links

- **Documentation:** [rainlog.marvin8.zone](https://rainlog.marvin8.zone/)
- **Source:** [codeberg.org/marvin8/rainlog](https://codeberg.org/marvin8/rainlog)
- **Issues:** [codeberg.org/marvin8/rainlog/issues](https://codeberg.org/marvin8/rainlog/issues)
- **Changelog:** [CHANGELOG.md](https://codeberg.org/marvin8/rainlog/src/branch/main/CHANGELOG.md)
