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.

Browser navigation tests

Browser tests are optional and skip if Playwright or Chromium is unavailable. Install and run them without adding a runtime dependency:

uv run --with playwright python -m playwright install chromium
uv run --with playwright pytest tests/test_navigation_options.py -q

These tests exercise long TOCs, desktop and mobile layouts, print layout, and navigation in full documents and fragments.

Styling resources

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. With the default rich profile and JavaScript enabled, 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. The portable and content profiles omit expansion and zoom controls. See artifact options for details.

Metadata

Release files for report-toolkit 0.3.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.3.0
File Size Uploaded Provenance
report_toolkit-0.3.0.tar.gz 82.0 kB With provenance Details

Built distribution (wheel)

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

Total release size: 132.9 kB

Release files / report_toolkit-0.3.0.tar.gz

Download URL report_toolkit-0.3.0.tar.gz
Size 82.0 kB
Tags Source
SHA-256 checksum
How to use checksums
4cabb6a5cd85607a5fa284ec6eb2b5640cb46e0b35b8f16f2c78700fd7722a73
BLAKE2b-256 checksum
How to use checksums
a564759638827ffbccb3732faf609572c8d7d64bafaacf66144a323756be4d1d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.12.24 {"installer":{"name":"uv","version":"0.12.24","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 8, 2026.

Transparency log

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

Download URL report_toolkit-0.3.0-py3-none-any.whl
Size 50.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
b5f4f929873e7943e6a3dec1fec2e0fa8aa35bfa23396ea6c38bb6065d8574f3
BLAKE2b-256 checksum
How to use checksums
342da418992d3fb6e532e2b0a3fd8fe622b9ada2a944ad84901d08888a5bd536
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.12.24 {"installer":{"name":"uv","version":"0.12.24","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 8, 2026.

Transparency log

Security for report-toolkit 0.3.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.3.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 8, 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