Metadata-Version: 2.4
Name: onsaemiro
Version: 1.1.0
Summary: Scientific presentation utilities for figures, notebooks, and terminals
Author-email: Hanseul Kang <hanseul.kang@aalto.fi>
License-Expression: MIT
Project-URL: Repository, https://github.com/PentagonToy/Onsaemiro
Project-URL: Issues, https://github.com/PentagonToy/Onsaemiro/issues
Project-URL: Changelog, https://github.com/PentagonToy/Onsaemiro/blob/main/CHANGELOG.md
Keywords: matplotlib,scientific-visualisation,publication,plotting,jupyter
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Science/Research
Classifier: Programming Language :: Python :: 3
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 :: Scientific/Engineering :: Visualization
Requires-Python: >=3.10
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: numpy>=1.24
Requires-Dist: matplotlib>=3.6
Requires-Dist: ipython>=8
Provides-Extra: dev
Requires-Dist: mypy>=1.10; extra == "dev"
Requires-Dist: pytest>=8; extra == "dev"
Provides-Extra: docs
Requires-Dist: mkdocs-material>=9.5; extra == "docs"
Dynamic: license-file

# Onsaemiro

**Publication-ready figures and portable scientific output for Python.**

Onsaemiro is a small presentation layer for Matplotlib figures, notebook output, and terminal reports. It provides journal-sized layouts, accessible visual styles, tables, progress reporting, and concise status output without wrapping Matplotlib's plotting API.

The default style follows the Science single-column preset. Other journal presets and explicit physical sizes remain available.

## Installation

```bash
pip install onsaemiro
```

## Figures

Create figures directly, then use ordinary Matplotlib methods:

```python
import onsaemiro as osm

osm.set_style(palette="okabe-ito")
fig, ax = osm.subplots(journal="science", column="single")

styles = osm.build_style_map(["baseline", "model"])
ax.plot(x, baseline, **styles["baseline"], label="Baseline")
ax.plot(x, prediction, **styles["model"], label="Model")
osm.finalize(ax)

osm.export_figure(fig, "figures/comparison", formats=("pdf", "png"))
```

`figsize(journal, column)` returns a configured physical size when only the dimensions are needed. Presets are practical starting points; always check the journal's current author instructions.

## Tables and progress

Tables provide both plain-text and HTML representations, so the same object is readable in notebooks, terminals, and redirected logs:

```python
table = osm.Table("Model comparison", ["Case", "RMSE"])
table.add_row("baseline", 0.041)
table.add_row("model", 0.018)
table.show()
```

Use `track()` for iterable work or update a progress object explicitly:

```python
for case in osm.track(cases, desc="Evaluating"):
    evaluate(case)

progress = osm.Progress(total=epochs, desc="Training")
for epoch in range(epochs):
    loss = train(epoch)
    progress.set(loss=f"{loss:.4f}")
    progress.update()
progress.finish()
```

## Terminal output

```python
osm.echo("Run completed", tone="success")
osm.rule("Summary")
```

Colour is used only when the output supports it. Redirected output remains plain, and `NO_COLOR` and `TERM=dumb` are respected.

See the [journal guide](docs/journal.md), [API reference](docs/api.md), and [changelog](CHANGELOG.md) for the complete public surface and release history.
