report-creator


Namereport-creator JSON
Version 1.0.37 PyPI version JSON
download
home_pagehttps://github.com/darenr/report_creator
SummaryCreate self-contained HTML reports from Python.
upload_time2025-01-09 21:29:13
maintainerDaren Race
docs_urlNone
authorDaren Race
requires_python>=3.9
licenseMIT
keywords python html reports report creator generator markdown yaml plot chart table blog
VCS
bugtrack_url
requirements pandas pyarrow numpy matplotlib mistune pyyaml plotly plotly-express Jinja2 humanize beautifulsoup4 python-dateutil requests pillow md4mathjax emoji setuptools
Travis-CI No Travis.
coveralls test coverage
            # Report Creator

[![License](https://img.shields.io/badge/license-MIT-blue.svg?style=for-the-badge)](https://www.apache.org/licenses/LICENSE-2.0)
[![PyPI Version](https://img.shields.io/pypi/v/report_creator.svg?style=for-the-badge&color=blue)](https://pypi.org/project/report_creator)
[![Python Versions](https://img.shields.io/pypi/pyversions/report_creator.svg?logo=python&logoColor=white&style=for-the-badge)](https://pypi.org/project/report_creator)
[![Python Stats](https://img.shields.io/pypi/dw/report_creator?style=for-the-badge)](https://pypi.org/project/report_creator)
[![Discord](https://img.shields.io/discord/1318814951795593236?style=for-the-badge)](https://discord.gg/c4VZp5ze)

[GitHub](https://github.com/darenr/report_creator) | 
[PyPI](https://pypi.org/project/report_creator/) | 
[Documentation](https://report-creator.readthedocs.io) | 
[Issues](https://github.com/darenr/report_creator/issues) | 
[Getting Started](https://report-creator.readthedocs.io/en/latest/getting_started.html)

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

- [x] Good pandas/dataframe/table support
- [x] Look modern
- [x] Allows markdown as input for text blocks
- [x] Allows html as input
- [x] Components for things like metrics ("Accuracy: 87%") from a key & value
- [x] Support for plotting figures, interactive `plotly` and `matplotlib`
- [x] images (styled by the library) with an option to fetch at report build time (no fetch on render)
- [x] `json`/`yaml`/`python`/`java`/`prolog` code blocks with color syntax highlighting
- [x] Support tab containers (not printer friendly)
- [x] Add support for any Jupyter widget, any object that renders in a notebook should render to a report
- [x] Add built-in easy plotting that looks stylistically consistent with the report
- [x] Add option to change the report icon based on a github account avatar, or an image
- [x] Add a metric type for timeseries data which should some aggregate function of the data, and plot over time.
- [x] Add diagram component with Mermaid JS
- [x] Write documentation!
- [x] Add a status metric that supports up to a handful of k/v pairs (k=task, v=status)
- [x] Add bookmark anchors to blocks
- [x] Add Footer to report
- [x] Add accordion component
- [x] Add option for color logo (uses accent color param passed to ReportCreator ctor)
- [x] Clean up docs build, move requirements-doc into docs/environment.yaml "- -r requirements.txt"
- [x] 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](https://www.googlecloudcommunity.com/gc/image/serverpage/image-id/73682iEC88C630172A41FA/image-size/large)
- [ ] 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

```python
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")
```

## 🤗 Code Structure

```mermaid
graph TD
    subgraph "UI"
        API[Report Creator API]
        COMP[Components]
        API --> COMP
    end

    subgraph "Core"
        RC[Engine]
        TS[Templates]
        TM[Themes]
        CR[Renderer]
        
        RC --> TS
        RC --> TM
        RC --> CR
        COMP --> CR
    end

    subgraph "Integration"
        PL[Plotting]
        MD[Markdown]
        SH[Syntax]
        MJ[Mermaid]
        JW[Jupyter]
        
        CR --> PL
        CR --> MD
        CR --> SH
        CR --> MJ
        CR --> JW
    end

    subgraph "Output"
        HG[HTML]
        AB[Assets]
        DT[Template]
        
        CR --> HG
        HG --> AB
        TS --> DT
        DT --> HG
    end

    subgraph "Utils"
        UT[Utils]
        VM[Version]
        PI[Init]
        
        RC --> UT
        RC --> VM
        RC --> PI
    end

    classDef core fill:#2374ab,color:white
    classDef integration fill:#47a025,color:white
    classDef output fill:#a442f5,color:white
    classDef utility fill:#f58442,color:white

    class API,RC,TS,TM,CR core
    class PL,MD,SH,MJ,JW integration
    class HG,AB,DT output
    class UT,VM,PI utility

    click RC "https://github.com/darenr/report_creator/blob/main/report_creator/report_creator.py"
    click TS "https://github.com/darenr/report_creator/tree/main/report_creator/templates/"
    click TM "https://github.com/darenr/report_creator/blob/main/report_creator/theming.py"
    click UT "https://github.com/darenr/report_creator/blob/main/report_creator/utilities.py"
    click COMP "https://github.com/darenr/report_creator/blob/main/tests/test_components.py"
    click DT "https://github.com/darenr/report_creator/blob/main/report_creator/templates/default.html"
    click VM "https://github.com/darenr/report_creator/blob/main/report_creator/__version__.py"
    click PI "https://github.com/darenr/report_creator/blob/main/report_creator/__init__.py"
```

## 🤗 Development

```sh
conda create --name rc 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 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](https://github.com/darenr/report_creator/issues).
- Chat with the maintainers on [Discord](https://discord.com/channels/1318814951795593236/1318814951795593239).

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/darenr/report_creator",
    "name": "report-creator",
    "maintainer": "Daren Race",
    "docs_url": null,
    "requires_python": ">=3.9",
    "maintainer_email": "daren.race@gmail.com",
    "keywords": "python, html, reports, report, creator, generator, markdown, yaml, plot, chart, table, blog",
    "author": "Daren Race",
    "author_email": "daren.race@gmail.com",
    "download_url": "https://files.pythonhosted.org/packages/5b/fd/3ccbf98e7022ed534c6aa9a3b3c90a44b057772202a187f18a9bf214fe77/report_creator-1.0.37.tar.gz",
    "platform": null,
    "description": "# Report Creator\n\n[![License](https://img.shields.io/badge/license-MIT-blue.svg?style=for-the-badge)](https://www.apache.org/licenses/LICENSE-2.0)\n[![PyPI Version](https://img.shields.io/pypi/v/report_creator.svg?style=for-the-badge&color=blue)](https://pypi.org/project/report_creator)\n[![Python Versions](https://img.shields.io/pypi/pyversions/report_creator.svg?logo=python&logoColor=white&style=for-the-badge)](https://pypi.org/project/report_creator)\n[![Python Stats](https://img.shields.io/pypi/dw/report_creator?style=for-the-badge)](https://pypi.org/project/report_creator)\n[![Discord](https://img.shields.io/discord/1318814951795593236?style=for-the-badge)](https://discord.gg/c4VZp5ze)\n\n[GitHub](https://github.com/darenr/report_creator) | \n[PyPI](https://pypi.org/project/report_creator/) | \n[Documentation](https://report-creator.readthedocs.io) | \n[Issues](https://github.com/darenr/report_creator/issues) | \n[Getting Started](https://report-creator.readthedocs.io/en/latest/getting_started.html)\n\nLibrary to assemble reports in HTML from various components using python. This is not meant to be a replacement for do-it-yourself HTML,\nit's a tool to put together professional looking reports from python easily and quickly. The philosophy for layout is that components flow in\neither the horizontal (`rc.Group`) or Vertical (`rc.Block`) direction.\n\n## \u26a1 Features\n\n- [x] Good pandas/dataframe/table support\n- [x] Look modern\n- [x] Allows markdown as input for text blocks\n- [x] Allows html as input\n- [x] Components for things like metrics (\"Accuracy: 87%\") from a key & value\n- [x] Support for plotting figures, interactive `plotly` and `matplotlib`\n- [x] images (styled by the library) with an option to fetch at report build time (no fetch on render)\n- [x] `json`/`yaml`/`python`/`java`/`prolog` code blocks with color syntax highlighting\n- [x] Support tab containers (not printer friendly)\n- [x] Add support for any Jupyter widget, any object that renders in a notebook should render to a report\n- [x] Add built-in easy plotting that looks stylistically consistent with the report\n- [x] Add option to change the report icon based on a github account avatar, or an image\n- [x] Add a metric type for timeseries data which should some aggregate function of the data, and plot over time.\n- [x] Add diagram component with Mermaid JS\n- [x] Write documentation!\n- [x] Add a status metric that supports up to a handful of k/v pairs (k=task, v=status)\n- [x] Add bookmark anchors to blocks\n- [x] Add Footer to report\n- [x] Add accordion component\n- [x] Add option for color logo (uses accent color param passed to ReportCreator ctor)\n- [x] Clean up docs build, move requirements-doc into docs/environment.yaml \"- -r requirements.txt\"\n- [x] Add mistune plugin to allow gfk markdown icons - `:icon-name:`, for example `:pizza:`\n- [ ] Add a Metric type for a sortable set of key/values rendered like this [Percent of time](https://www.googlecloudcommunity.com/gc/image/serverpage/image-id/73682iEC88C630172A41FA/image-size/large)\n- [ ] Progress component\n- [ ] Add Venn diagram support (possibly with `matplotlib_venn`, or SVG)\n- [ ] Add Radar chart\n- [ ] Add choropleth map plot type (maybe?)\n- [ ] Youtube embeds rc.Video(url: str, label: str)\n- [ ] File attachments (downloadable dataset from page)\n\n## \u26a1 Example\n\n```python\nimport report_creator as rc\n\nwith rc.ReportCreator(\n    title=\"My Report\",\n    description=\"My Report Description\",\n    footer=\"My Report Footer\",\n) as report:\n    view = rc.Block(\n        rc.Text(\n            \"\"\"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.\"\"\",\n            label=\"Charles Dickens, A Tale of Two Cities\",\n        ),\n        rc.Group(\n            rc.Metric(\n                heading=\"Answer to Life, The Universe, and Everything\",\n                value=\"42\",\n            ),\n            rc.Metric(\n                heading=\"Author\",\n                value=\"Douglas Adams\",\n            ),\n        ),\n        rc.Bar(\n            px.data.medals_long(),\n            x=\"nation\",\n            y=\"count\",\n            dimension=\"medal\",\n            label=\"Bar Chart - Olympic Medals\",\n        ),\n        rc.Scatter(\n            px.data.iris(),\n            x=\"sepal_width\",\n            y=\"sepal_length\",\n            dimension=\"species\",\n            marginal=\"histogram\",\n            label=\"Scatter Plot - Iris\",\n        ),\n    )\n\n    report.save(view, \"report.html\")\n```\n\n## \ud83e\udd17 Code Structure\n\n```mermaid\ngraph TD\n    subgraph \"UI\"\n        API[Report Creator API]\n        COMP[Components]\n        API --> COMP\n    end\n\n    subgraph \"Core\"\n        RC[Engine]\n        TS[Templates]\n        TM[Themes]\n        CR[Renderer]\n        \n        RC --> TS\n        RC --> TM\n        RC --> CR\n        COMP --> CR\n    end\n\n    subgraph \"Integration\"\n        PL[Plotting]\n        MD[Markdown]\n        SH[Syntax]\n        MJ[Mermaid]\n        JW[Jupyter]\n        \n        CR --> PL\n        CR --> MD\n        CR --> SH\n        CR --> MJ\n        CR --> JW\n    end\n\n    subgraph \"Output\"\n        HG[HTML]\n        AB[Assets]\n        DT[Template]\n        \n        CR --> HG\n        HG --> AB\n        TS --> DT\n        DT --> HG\n    end\n\n    subgraph \"Utils\"\n        UT[Utils]\n        VM[Version]\n        PI[Init]\n        \n        RC --> UT\n        RC --> VM\n        RC --> PI\n    end\n\n    classDef core fill:#2374ab,color:white\n    classDef integration fill:#47a025,color:white\n    classDef output fill:#a442f5,color:white\n    classDef utility fill:#f58442,color:white\n\n    class API,RC,TS,TM,CR core\n    class PL,MD,SH,MJ,JW integration\n    class HG,AB,DT output\n    class UT,VM,PI utility\n\n    click RC \"https://github.com/darenr/report_creator/blob/main/report_creator/report_creator.py\"\n    click TS \"https://github.com/darenr/report_creator/tree/main/report_creator/templates/\"\n    click TM \"https://github.com/darenr/report_creator/blob/main/report_creator/theming.py\"\n    click UT \"https://github.com/darenr/report_creator/blob/main/report_creator/utilities.py\"\n    click COMP \"https://github.com/darenr/report_creator/blob/main/tests/test_components.py\"\n    click DT \"https://github.com/darenr/report_creator/blob/main/report_creator/templates/default.html\"\n    click VM \"https://github.com/darenr/report_creator/blob/main/report_creator/__version__.py\"\n    click PI \"https://github.com/darenr/report_creator/blob/main/report_creator/__init__.py\"\n```\n\n## \ud83e\udd17 Development\n\n```sh\nconda create --name rc python=3.13\nconda activate rc\nmake setup\n\n# recommended for code hygiene\nmake format\n\n# install as a local package:\npython3 -m pip install -e .\n\n# see dependency tree:\npipdeptree --exclude pip,pipdeptree,setuptools,wheel,twine\n\n# build examples:\nmake examples\n\n# build a *specific* example:\nmake examples EXAMPLES=examples/myreport.py\n\n# run tests\nmake tests\n\n# build docs\nmake docs\n\n# release new version\nmake release\n\n# show list of make targets\nmake targets\n\n```\n\n## Get in touch\n\nThis project is under active development\n\n- Report bugs via [GitHub Issues](https://github.com/darenr/report_creator/issues).\n- Chat with the maintainers on [Discord](https://discord.com/channels/1318814951795593236/1318814951795593239).\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "Create self-contained HTML reports from Python.",
    "version": "1.0.37",
    "project_urls": {
        "Homepage": "https://github.com/darenr/report_creator"
    },
    "split_keywords": [
        "python",
        " html",
        " reports",
        " report",
        " creator",
        " generator",
        " markdown",
        " yaml",
        " plot",
        " chart",
        " table",
        " blog"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "d85fe6c71ff946dee2170f0535b9507aa50664adb84b3c9c7176da7397736d83",
                "md5": "f613a88deba08fab7f09cb5f63f19d4a",
                "sha256": "e296d76e2b9fd5c9397be5443e2ff880355c2dd50fabcb0ae8099939943fd12c"
            },
            "downloads": -1,
            "filename": "report_creator-1.0.37-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "f613a88deba08fab7f09cb5f63f19d4a",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.9",
            "size": 25156,
            "upload_time": "2025-01-09T21:29:07",
            "upload_time_iso_8601": "2025-01-09T21:29:07.401899Z",
            "url": "https://files.pythonhosted.org/packages/d8/5f/e6c71ff946dee2170f0535b9507aa50664adb84b3c9c7176da7397736d83/report_creator-1.0.37-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "5bfd3ccbf98e7022ed534c6aa9a3b3c90a44b057772202a187f18a9bf214fe77",
                "md5": "6a868a1a3fac966717535621237fea94",
                "sha256": "7fc12959abde81440bf3ad00215389dd774478085ffaaf73d2f8b03fa7612c08"
            },
            "downloads": -1,
            "filename": "report_creator-1.0.37.tar.gz",
            "has_sig": false,
            "md5_digest": "6a868a1a3fac966717535621237fea94",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.9",
            "size": 30460,
            "upload_time": "2025-01-09T21:29:13",
            "upload_time_iso_8601": "2025-01-09T21:29:13.706458Z",
            "url": "https://files.pythonhosted.org/packages/5b/fd/3ccbf98e7022ed534c6aa9a3b3c90a44b057772202a187f18a9bf214fe77/report_creator-1.0.37.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2025-01-09 21:29:13",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "darenr",
    "github_project": "report_creator",
    "travis_ci": false,
    "coveralls": true,
    "github_actions": false,
    "requirements": [
        {
            "name": "pandas",
            "specs": []
        },
        {
            "name": "pyarrow",
            "specs": []
        },
        {
            "name": "numpy",
            "specs": []
        },
        {
            "name": "matplotlib",
            "specs": []
        },
        {
            "name": "mistune",
            "specs": [
                [
                    ">=",
                    "3.0.2"
                ]
            ]
        },
        {
            "name": "pyyaml",
            "specs": []
        },
        {
            "name": "plotly",
            "specs": []
        },
        {
            "name": "plotly-express",
            "specs": []
        },
        {
            "name": "Jinja2",
            "specs": []
        },
        {
            "name": "humanize",
            "specs": []
        },
        {
            "name": "beautifulsoup4",
            "specs": []
        },
        {
            "name": "python-dateutil",
            "specs": []
        },
        {
            "name": "requests",
            "specs": []
        },
        {
            "name": "pillow",
            "specs": []
        },
        {
            "name": "md4mathjax",
            "specs": []
        },
        {
            "name": "emoji",
            "specs": []
        },
        {
            "name": "setuptools",
            "specs": []
        }
    ],
    "lcname": "report-creator"
}
        
Elapsed time: 0.41934s