Skip to main content

Create self-contained HTML reports from Python.

Project description

Report Creator

PyPI Version Python Versions

GitHub Actions Workflow Status Read the Docs

License

GitHub | PyPI | Documentation | Issues | Getting Started

Library to assemble reports in HTML from various components using python. This is not meant to be a replacement for do-it-yourself HTML, it's a tool to put together professional looking reports from python easily and quickly. The philosophy for layout is that components flow in either the horizontal (rc.Group()) or Vertical (rc.Block()) direction.

New in v1.2.5 create slide decks using rc.Deck() and rc.Slide() components. See the Deck example.

Talk to this repo using DeepWiki Report Creator

Use the documentation in Cursor, Windsurf, Claude Desktop or another MCP Client via the Context7 MCP for example

Create an html report on this dataframe, use context7

Features

Data & Visualization

  • Deep Pandas Integration: Native support for DataFrames in Table, DataTable (searcheable/sortable), and Metric components.
  • Interactive Plotting: Full support for Plotly figures with a custom theme for professional-looking charts by default.
  • Matplotlib & Seaborn: Automatic detection and rendering of Matplotlib and Seaborn objects, with consistent styling using a context manager.
  • Specialized Charts: Built-in components for Radar charts, Bar, Line, Pie, Scatter, Box, and Histogram.
  • Advanced Metrics: Metric and MetricGroup for KPI displays, including EventMetric for time-series frequency analysis.

Content & Layout

  • Rich Layout System: Flexible report structuring using rc.Block() (vertical) and rc.Group() (horizontal) stacks.
  • Modern UI Components: Interactive elements like Accordion/Collapse sections and Select tabbed interfaces.
  • Superior Markdown: Full GitHub Flavored Markdown (GFM) support, including Emojis, Math (LaTeX), and RST directives.
  • Diagrams as Code: Native Mermaid.js support for flowcharts, sequence diagrams, and more, with built-in pan and zoom.

Technical Capabilities

  • Syntax Highlighting: Code blocks with support for multiple languages including Sql, Python, Yaml, and Json.
  • SQL Prettifier: Heuristic formatting for SQL queries to improve readability in reports.
  • Smart Media Handling: Images and Galleries can be local, remote (fetched at build time), or Base64 encoded, with automatic styling.
  • Self-Contained Output: Generates standalone HTML files that bundle only the required JavaScript dependencies (Plotly, DataTables, etc.).
  • Deterministic Styling: Automatic, repeatable color generation for headings and labels to ensure visual consistency.

Example

import report_creator as rc

with rc.ReportCreator(
    title="My Report",
    description="My Report Description",
    footer="My Report Footer",
    accent_color="red",
) as report:
    view = rc.Block(
        rc.Text(
            """It was the best of times, it was the worst of times, it was the age of wisdom, it was the age of foolishness, it was the epoch of belief, it was the epoch of incredulity, it was the season of light, it was the season of darkness, it was the spring of hope, it was the winter of despair.""",
            label="Charles Dickens, A Tale of Two Cities",
        ),
        rc.Group(
            rc.Metric(
                heading="Answer to Life, The Universe, and Everything",
                value="42",
            ),
            rc.Metric(
                heading="Author",
                value="Douglas Adams",
            ),
        ),
        rc.Bar(
            px.data.medals_long(),
            x="nation",
            y="count",
            dimension="medal",
            label="Bar Chart - Olympic Medals",
        ),
        rc.Scatter(
            px.data.iris(),
            x="sepal_width",
            y="sepal_length",
            dimension="species",
            marginal="histogram",
            label="Scatter Plot - Iris",
        ),
    )

    report.save(view, "report.html")

Development

This project has been configured for Claude Clode. These are entirely optional to use for development.

conda create -n rc -c conda-forge python=3.13
conda activate rc
make setup

# recommended for code hygiene
make format

# install as a local package:
python3 -m pip install -e .

# see dependency tree:
pipdeptree --exclude pip,pipdeptree,setuptools,wheel,twine

# build examples:
make examples

# build a *specific* example:
make examples EXAMPLES=examples/myreport.py

# run tests
make tests

# build doc
make doc

# release new version
make release

# show list of make targets
make targets

Get in touch

This project is under active development

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

report_creator-1.2.5.tar.gz (82.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

report_creator-1.2.5-py3-none-any.whl (66.5 kB view details)

Uploaded Python 3

File details

Details for the file report_creator-1.2.5.tar.gz.

File metadata

  • Download URL: report_creator-1.2.5.tar.gz
  • Upload date:
  • Size: 82.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.13

File hashes

Hashes for report_creator-1.2.5.tar.gz
Algorithm Hash digest
SHA256 cda0c9b2e90d1d98289f04c4befbcffa35913560c8404e11c538ab1a9595a890
MD5 8a7cb15a59a5c7d9efff04ef056a570f
BLAKE2b-256 859ec1f62322adea8ce4292b62ff4940bef9b1efc922383fef6d3d5a36384602

See more details on using hashes here.

File details

Details for the file report_creator-1.2.5-py3-none-any.whl.

File metadata

  • Download URL: report_creator-1.2.5-py3-none-any.whl
  • Upload date:
  • Size: 66.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.13

File hashes

Hashes for report_creator-1.2.5-py3-none-any.whl
Algorithm Hash digest
SHA256 c1acd56fb940f6e722f14bd6258cf9a1eccf39406200d178dabd530e50236eb0
MD5 9adb3c8aedd1134f087c49716fe22ccb
BLAKE2b-256 dc89922c73c6f7428fa1dd38ca0ee7f790a4ceb1a2cb2d7e9970d18773f61540

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page