Skip to main content

Produce self-contained HTML reports from Python, no HTML required.

Project description

Report Creator

License PyPI Version Python Versions Python Stats Repo Size

Library to assemble reports in HTML from various components using python

Features

  • Good pandas/dataframe/table support
  • Look modern
  • Allows markdown as input for text blocks
  • Allows html as input
  • A few simple components for things like metrics ("Accuracy: 87%") from a triple of key, value
  • Support for plotting figures, interactive plotly and matplotlib
  • images (styled by the library)
  • json/yaml/python code blocks with color syntax highlighting
  • Support tabs
  • Add support for any Jupyter widget, any object that renders in a notebook should render to a report
  • Add built-in easy plotting that looks stylistically consistent with the report
  • Add option to change the report icon based on a github account avatar
  • Add a metric type for timeseries data which should some aggregate function of the data, and plot over time.
  • Add a status metric that supports up to a handful of k/v pairs (k=task, v=status)
  • Add Calendar
  • Add yfinance plots/tables (maybe)
  • Add Radar chart
  • Add choropleth map plot type
  • Add bookmark anchors to blocks
  • Add a Table of Contents option based on labels of top-level-blocks
  • Add styled section for Executive Summary
  • Youtube embeds rc.Video(url: str, label: str)
  • File attachments (downloadable any data from page)
  • Write some documentation!

Example

import report_creator as rc

with rc.ReportCreator("My Report") 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

conda create --name rc python=3.12
conda activate rc
pip install -r requirements.txt -U

# recommended installs for code hygiene
pip install ruff

# build "kitchen_sink" example
make

# install local package
pip install -e .

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

Dev Notes

  • 4/18/24 - no breaking changes, all changes should go through standard deprecation policies
  • The Blocks/Groups use css flex.
    • Blocks flow vertically (columns)
  • Groups flow horizontal (row).
  • To render math you'll need to pip install md4mathjax
  • Design ideas

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.0.21.tar.gz (21.6 kB view details)

Uploaded Source

Built Distribution

report_creator-1.0.21-py3-none-any.whl (20.1 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: report_creator-1.0.21.tar.gz
  • Upload date:
  • Size: 21.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.9.12

File hashes

Hashes for report_creator-1.0.21.tar.gz
Algorithm Hash digest
SHA256 3a8ae104478b49bea889d9ee8389cc3c8c53045e1f717b4e5e0c25bfc23b90d0
MD5 2dfb63f5e3f6a894c65c37720af6d8a9
BLAKE2b-256 eaefb03c5154e8f85aab1e20fefcbfa7a3d04874071fe5082ca4c04118cf1e6b

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for report_creator-1.0.21-py3-none-any.whl
Algorithm Hash digest
SHA256 49fc0be41c7586e142841c156e6ef7de6d1f84cfeea8461d416a6f26920d429d
MD5 6e3ac3e3ac4e04610ca3dd82d8eec43c
BLAKE2b-256 f6c459d0286e1f0aabb02cfb3d34849f59ccb52db59a1bf402af38524639064f

See more details on using hashes here.

Supported by

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