report-creator 1.0.3__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2024 Daren Race
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,3 @@
1
+ include README.md
2
+ include LICENSE
3
+ include report_creator/templates/*
@@ -0,0 +1,110 @@
1
+ Metadata-Version: 2.1
2
+ Name: report_creator
3
+ Version: 1.0.3
4
+ Summary: Produce self-contained HTML reports from Python
5
+ Home-page: https://github.com/darenr/report_creator
6
+ Author: Daren Race
7
+ Author-email: daren.race@gmail.com
8
+ License: Apache License, Version 2.0, January 2004
9
+ Keywords: python,html,reports,report,creator,generator,markdown,yaml,plot,chart,table
10
+ Classifier: Development Status :: 5 - Production/Stable
11
+ Classifier: Topic :: Software Development :: Libraries :: Application Frameworks
12
+ Classifier: License :: OSI Approved :: Apache Software License
13
+ Classifier: Programming Language :: Python :: 3.8
14
+ Classifier: Programming Language :: Python :: 3.9
15
+ Classifier: Programming Language :: Python :: 3.10
16
+ Classifier: Programming Language :: Python :: 3.11
17
+ Description-Content-Type: text/markdown
18
+ License-File: LICENSE
19
+
20
+ # Report Creator
21
+
22
+ [![License](https://img.shields.io/badge/license-Apache-blue.svg?style=for-the-badge)](https://www.apache.org/licenses/LICENSE-2.0)
23
+ [![PyPI Version](https://img.shields.io/pypi/v/report_creator.svg?style=for-the-badge&color=blue)](https://pypi.org/project/report_creator)
24
+ [![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)
25
+
26
+ Library to assemble reports in HTML from various components using python
27
+
28
+ ## Features
29
+
30
+ * [x] Good pandas/dataframe/table support
31
+ * [x] Look modern
32
+ * [x] Allows markdown as input for text blocks
33
+ * [x] Allows html as input
34
+ * [x] A few simple components for things like metrics ("Accuracy: 87%") from a triple of key, value
35
+ * [x] Support for plotting figures, interactive `plotly` and `matplotlib`
36
+ * [x] images (styled by the library)
37
+ * [x] `json`/`yaml`/`python` code blocks with color syntax highlighting
38
+ * [x] Support tabs
39
+ * [x] Add support for any Jupyter widget, any object that renders in a notebook should render to a report
40
+ * [x] Add built-in easy plotting that looks stylistically consistent with the report
41
+ * [ ] Add bookmark anchors to blocks
42
+ * [ ] Add a Table of Contents option based on labels of top-level-blocks
43
+ * [ ] Youtube embeds rc.Video(url: str, label: str)
44
+ * [ ] File attachments (downloadable from page)
45
+
46
+ ## Example
47
+
48
+ ```python3
49
+
50
+ import report_creator as rc
51
+
52
+ with rc.ReportCreator("My Report") as report:
53
+
54
+ view = rc.Block(
55
+ 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.""",
56
+ label="Charles Dickens, A Tale of Two Cities"),
57
+ rc.Group(
58
+ rc.Metric(
59
+ heading="Answer to Life, The Universe, and Everything",
60
+ value="42",
61
+ ),
62
+ rc.Metric(
63
+ heading="Author",
64
+ value="Douglas Adams",
65
+ ),
66
+ ),
67
+ rc.Bar(
68
+ px.data.medals_long(),
69
+ x="nation",
70
+ y="count",
71
+ dimension="medal",
72
+ label="Bar Chart - Olympic Medals",
73
+ ),
74
+ rc.Scatter(
75
+ df=px.data.iris(),
76
+ x="sepal_width",
77
+ y="sepal_length",
78
+ dimension="species",
79
+ marginal="histogram",
80
+ label="Scatter Plot - Iris",
81
+ ),
82
+ )
83
+
84
+ report.save(view, "report.html")
85
+ ```
86
+
87
+ ## Development
88
+
89
+ ``` .python
90
+ conda create --name rc python=3.9
91
+ conda activate rc
92
+ pip install -r requirements.txt -U
93
+
94
+ # optionally for pretty html generation
95
+ pip install beautifulsoup4 lxml
96
+
97
+ # recommended installs for code hygiene
98
+ pip install ruff
99
+
100
+ # build "kitchen_sink" example
101
+ make
102
+ ```
103
+
104
+ ## Dev Notes
105
+
106
+ * **4/18/24 - no breaking changes**, all changes should go through standard deprecation policies
107
+ * The Blocks/Groups use css [flex](https://css-tricks.com/snippets/css/a-guide-to-flexbox/).
108
+ * Blocks flow vertically (columns)
109
+ * Groups flow horizontal (row).
110
+ * To render math you'll need to `pip install md4mathjax`
@@ -0,0 +1,91 @@
1
+ # Report Creator
2
+
3
+ [![License](https://img.shields.io/badge/license-Apache-blue.svg?style=for-the-badge)](https://www.apache.org/licenses/LICENSE-2.0)
4
+ [![PyPI Version](https://img.shields.io/pypi/v/report_creator.svg?style=for-the-badge&color=blue)](https://pypi.org/project/report_creator)
5
+ [![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)
6
+
7
+ Library to assemble reports in HTML from various components using python
8
+
9
+ ## Features
10
+
11
+ * [x] Good pandas/dataframe/table support
12
+ * [x] Look modern
13
+ * [x] Allows markdown as input for text blocks
14
+ * [x] Allows html as input
15
+ * [x] A few simple components for things like metrics ("Accuracy: 87%") from a triple of key, value
16
+ * [x] Support for plotting figures, interactive `plotly` and `matplotlib`
17
+ * [x] images (styled by the library)
18
+ * [x] `json`/`yaml`/`python` code blocks with color syntax highlighting
19
+ * [x] Support tabs
20
+ * [x] Add support for any Jupyter widget, any object that renders in a notebook should render to a report
21
+ * [x] Add built-in easy plotting that looks stylistically consistent with the report
22
+ * [ ] Add bookmark anchors to blocks
23
+ * [ ] Add a Table of Contents option based on labels of top-level-blocks
24
+ * [ ] Youtube embeds rc.Video(url: str, label: str)
25
+ * [ ] File attachments (downloadable from page)
26
+
27
+ ## Example
28
+
29
+ ```python3
30
+
31
+ import report_creator as rc
32
+
33
+ with rc.ReportCreator("My Report") as report:
34
+
35
+ view = rc.Block(
36
+ 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.""",
37
+ label="Charles Dickens, A Tale of Two Cities"),
38
+ rc.Group(
39
+ rc.Metric(
40
+ heading="Answer to Life, The Universe, and Everything",
41
+ value="42",
42
+ ),
43
+ rc.Metric(
44
+ heading="Author",
45
+ value="Douglas Adams",
46
+ ),
47
+ ),
48
+ rc.Bar(
49
+ px.data.medals_long(),
50
+ x="nation",
51
+ y="count",
52
+ dimension="medal",
53
+ label="Bar Chart - Olympic Medals",
54
+ ),
55
+ rc.Scatter(
56
+ df=px.data.iris(),
57
+ x="sepal_width",
58
+ y="sepal_length",
59
+ dimension="species",
60
+ marginal="histogram",
61
+ label="Scatter Plot - Iris",
62
+ ),
63
+ )
64
+
65
+ report.save(view, "report.html")
66
+ ```
67
+
68
+ ## Development
69
+
70
+ ``` .python
71
+ conda create --name rc python=3.9
72
+ conda activate rc
73
+ pip install -r requirements.txt -U
74
+
75
+ # optionally for pretty html generation
76
+ pip install beautifulsoup4 lxml
77
+
78
+ # recommended installs for code hygiene
79
+ pip install ruff
80
+
81
+ # build "kitchen_sink" example
82
+ make
83
+ ```
84
+
85
+ ## Dev Notes
86
+
87
+ * **4/18/24 - no breaking changes**, all changes should go through standard deprecation policies
88
+ * The Blocks/Groups use css [flex](https://css-tricks.com/snippets/css/a-guide-to-flexbox/).
89
+ * Blocks flow vertically (columns)
90
+ * Groups flow horizontal (row).
91
+ * To render math you'll need to `pip install md4mathjax`
@@ -0,0 +1,36 @@
1
+ from .__meta__ import (
2
+ __authors__,
3
+ __contact__,
4
+ __description__,
5
+ __license__,
6
+ __version__,
7
+ )
8
+ from .report_creator import (
9
+ Bar,
10
+ Base,
11
+ Block,
12
+ Box,
13
+ Collapse,
14
+ DataTable,
15
+ Group,
16
+ Heading,
17
+ Histogram,
18
+ Html,
19
+ Image,
20
+ Json,
21
+ Line,
22
+ Markdown,
23
+ Metric,
24
+ MetricGroup,
25
+ Pie,
26
+ Python,
27
+ ReportCreator,
28
+ Scatter,
29
+ Select,
30
+ Separator,
31
+ Table,
32
+ Text,
33
+ Unformatted,
34
+ Widget,
35
+ Yaml,
36
+ )
@@ -0,0 +1,6 @@
1
+ __version__ = "1.0.3"
2
+ __authors__ = "Daren Race"
3
+ __license__ = "Apache License, Version 2.0, January 2004"
4
+ __contact__ = "daren.race@gmail.com"
5
+ __license__ = "Apache License"
6
+ __description__ = "Produce self-contained HTML reports from Python"