Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

report-creator

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

report-creator

Create self-contained HTML reports from Python.

  • 1.0.36
  • PyPI
  • Socket score

Maintainers
1

Report Creator

License PyPI Version Python Versions Python Stats Discord

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.

⚡ Features

  • Good pandas/dataframe/table support
  • Look modern
  • Allows markdown as input for text blocks
  • Allows html as input
  • Components for things like metrics ("Accuracy: 87%") from a key & value
  • Support for plotting figures, interactive plotly and matplotlib
  • images (styled by the library) with an option to fetch at report build time (no fetch on render)
  • json/yaml/python/java/prolog code blocks with color syntax highlighting
  • Support tab containers (not printer friendly)
  • 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, or an image
  • Add a metric type for timeseries data which should some aggregate function of the data, and plot over time.
  • Add diagram component with Mermaid JS
  • Write documentation!
  • Add a status metric that supports up to a handful of k/v pairs (k=task, v=status)
  • Add bookmark anchors to blocks
  • Add Footer to report
  • Add accordion component
  • Add option for color logo (uses accent color param passed to ReportCreator ctor)
  • Clean up docs build, move requirements-doc into docs/environment.yaml "- -r requirements.txt"
  • Add mistune plugin to allow gfk markdown icons - :icon-name:, for example :pizza:
  • Add a Metric type for a sortable set of key/values rendered like this Percent of time
  • Progress component
  • Add Venn diagram support (possibly with matplotlib_venn, or SVG)
  • Add Radar chart
  • Add choropleth map plot type (maybe?)
  • Youtube embeds rc.Video(url: str, label: str)
  • File attachments (downloadable dataset from page)

⚡ Example

import report_creator as rc

with rc.ReportCreator(
    title="My Report",
    description="My Report Description",
    footer="My Report Footer",
) 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
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 docs
make docs

# release new version
make release

# show list of make targets
make targets

Get in touch

This project is under active development

  • Report bugs via GitHub Issues.
  • Chat with the maintainers on Discord.

Keywords

FAQs


Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc