Skip to main content

report-toolkit

Build analytical reports in Python or Markdown templates and export styled HTML with tables, charts, sections, and column layouts.

Install

Install the package:

pip install report-toolkit

From a checkout:

uv sync

For tables, charts, and YAML template metadata, use uv sync --extra all. Individual extras are pandas, altair, matplotlib, plotly, and templates; offline additionally supports embedding Altair's JavaScript.

Quick start

from report_toolkit import Report

report = Report('Sales review', author='Report author')
report.heading(1, 'Summary')
report.markdown('Revenue **increased** this month.')
report.unordered(['Review the results', 'Plan the next month'])
report.write('sales.html', toc=True)

Open sales.html in a browser.

Documentation

Start with Getting Started, use Common Tasks for recipes, and consult the API Reference for signatures and constraints. See the Changelog for release history and upcoming changes.

Two equivalent examples

Python composition and Markdown templates, using monthly_sales.md, generate the same sales report. They demonstrate shared text, list, table, chart, and layout capabilities.

uv run --extra all python examples/sales_report.py
uv run --extra all python examples/template_report.py

Each prints its report tree and output path. Open examples/sales_report.html and examples/template_report.html in a browser. Altair and Plotly charts require network access for their JavaScript. Raw HTML is covered in the recipes, since templates escape it.

Themes

Export with style={'mode': 'dark'}, or use style={'mode': 'auto'} to follow the reader's system appearance. Choose slate, azure, parchment, or ember with style={'palette': 'parchment'}. The default preserves the previous light appearance. Define reusable Style, Theme, and Palette objects; see Themes for customization and migration from theme=, and the theme gallery.

Rendering profiles

Use profile='rich' (the default) for interactive reports, profile='portable' for static SVG charts, or profile='content' for a content fragment with minimal layout CSS and interactive charts. Install portable for SVG exporters; Plotly also requires Chrome at export time. Derive immutable profiles with get_profile(...).with_overrides(...), including HTML tag-to-class mappings for host applications. See Rendering profiles.

Development

uv run --extra all pytest
uv run --extra all make test
uv run ruff check .
uv run ruff format --check .
uv run make build

make test and pytest both run the unittest-compatible suite, including the example integration test. Optional integration tests skip when dependencies are absent. Version tags run tests, Ruff lint, and a format check before the release workflow builds and publishes to PyPI.

Theming code lives in src/report_toolkit/themes/: structural defaults belong in theme.py, color values in palette.py, and configuration normalization in style.py. Edit src/report_toolkit/resources/report.css for static report CSS; HTML-specific scoping and dynamic style generation live in the writer. CSS is packaged with the library and embedded in exported HTML. After changing resources or package-data settings, run make build and verify the built distributions.

Artifact layout is configurable per item:

report.add(table, center=True)
report.add(chart, width='full', expand='always')
report.write('report.html', pretty=True)  # Compact markup is the default.

Tables and charts use native width by default and display their full height. Artifacts that overflow horizontally offer a bottom-right Expand button opening a centered expanded view with zoom controls and a Close icon. Zoom is available only in the expanded preview. See artifact options for details.

Metadata

Release files for report-toolkit 0.2.0

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

Source distribution (sdist)

Source distribution for report-toolkit 0.2.0
File Size Uploaded Provenance
report_toolkit-0.2.0.tar.gz 61.3 kB With provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for report-toolkit 0.2.0
File Interpreter ABI Platform
report_toolkit-0.2.0-py3-none-any.whl Python 3 none any Details

Total release size: 101.8 kB

Release files / report_toolkit-0.2.0.tar.gz

Download URL report_toolkit-0.2.0.tar.gz
Size 61.3 kB
Tags Source
SHA-256 checksum
How to use checksums
dd6b19e6eb463c09791fd524d0ab44fea528d52ab18407c77a3fe390af3fae1d
BLAKE2b-256 checksum
How to use checksums
72a912fef796ea00c5dcd10eb88c6a234458fc50e21e52f3a6c8b8dfb70c3235
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.12.21 {"installer":{"name":"uv","version":"0.12.21","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 1, 2026.

Transparency log

Release files / report_toolkit-0.2.0-py3-none-any.whl

Download URL report_toolkit-0.2.0-py3-none-any.whl
Size 40.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
33219a0cfd3b2db7ae466e26cfb4a8d18a23fb76b34608ca2d2b9274aa4a7f80
BLAKE2b-256 checksum
How to use checksums
b9433917ba9b1628861899f41d5420ff41981f3b7aa4e669067f6f539e5dddec
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.12.21 {"installer":{"name":"uv","version":"0.12.21","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 1, 2026.

Transparency log

Security for report-toolkit 0.2.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

All 2 files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for report_toolkit-0.2.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 1, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

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