Skip to main content

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

pip install onsaemiro

Figures

Create figures directly, then use ordinary Matplotlib methods:

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:

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

Existing pandas and Polars DataFrames can be presented without rebuilding their rows:

table = osm.Table.from_dataframe(
    dataframe=summary_df,
    title="Counterflow ranges",
    formatters={"phi": ".2f", "eta_ref": ".4f"},
)
table.show()

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

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

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, API reference, and changelog for the complete public surface and release history.

Metadata

Release files for onsaemiro 1.1.4

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for onsaemiro 1.1.4
File Size Uploaded
onsaemiro-1.1.4.tar.gz 25.3 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for onsaemiro 1.1.4
File Interpreter ABI Platform
onsaemiro-1.1.4-py3-none-any.whl Python 3 none any Details

Total release size: 46.5 kB

Release files / onsaemiro-1.1.4.tar.gz

Download URL onsaemiro-1.1.4.tar.gz
Size 25.3 kB
Tags Source
SHA-256 checksum
How to use checksums
ec5ae62a51afa38842570ed4e3088d06543ca0cf7c2e00e6544b89ccb4c24def
BLAKE2b-256 checksum
How to use checksums
8f472070a20a8f136e9a737d5d3ec19c69b63e2beaed6a0622fea4b2fcc31b30
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.13

Release files / onsaemiro-1.1.4-py3-none-any.whl

Download URL onsaemiro-1.1.4-py3-none-any.whl
Size 21.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
b1d822f866a617805c7a0f7ada2a82cfc14222549643bd7484117d1f570b6f24
BLAKE2b-256 checksum
How to use checksums
7ca35f532efa75275a873f57592451d369454a77a131bcb0a34cfb1f19a3e019
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.13
Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page