basic-report 0.1.0__py3-none-any.whl

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.
Files changed (38) hide show
  1. basic_report/__init__.py +10 -0
  2. basic_report/configs/default.yaml +185 -0
  3. basic_report/css_and_scripts/bootstrap.min.css +7 -0
  4. basic_report/css_and_scripts/bootstrap.min.js +7 -0
  5. basic_report/css_and_scripts/dataTables.bootstrap4.min.js +8 -0
  6. basic_report/css_and_scripts/jquery-3.3.1.slim.min.js +2 -0
  7. basic_report/css_and_scripts/jquery.dataTables.min.js +166 -0
  8. basic_report/css_and_scripts/popper.min.js +5 -0
  9. basic_report/page.py +827 -0
  10. basic_report/report.py +404 -0
  11. basic_report/templates/accordion.css +20 -0
  12. basic_report/templates/accordion.html +20 -0
  13. basic_report/templates/base.html +59 -0
  14. basic_report/templates/colors.css +30 -0
  15. basic_report/templates/columns.html +9 -0
  16. basic_report/templates/global_links.html +7 -0
  17. basic_report/templates/header.html +5 -0
  18. basic_report/templates/image.html +16 -0
  19. basic_report/templates/list.html +7 -0
  20. basic_report/templates/navbar.css +17 -0
  21. basic_report/templates/navbar_left.html +32 -0
  22. basic_report/templates/navbar_right.html +32 -0
  23. basic_report/templates/navbar_top.html +25 -0
  24. basic_report/templates/plot.html +4 -0
  25. basic_report/templates/report_ball_section.html +80 -0
  26. basic_report/templates/report_header.html +6 -0
  27. basic_report/templates/site.css +5 -0
  28. basic_report/templates/sublevel.html +7 -0
  29. basic_report/templates/table.css +51 -0
  30. basic_report/templates/table.html +55 -0
  31. basic_report/templates/tabs.css +20 -0
  32. basic_report/templates/tabs.html +29 -0
  33. basic_report/templates/text.html +3 -0
  34. basic_report/utils.py +246 -0
  35. basic_report-0.1.0.dist-info/METADATA +194 -0
  36. basic_report-0.1.0.dist-info/RECORD +38 -0
  37. basic_report-0.1.0.dist-info/WHEEL +4 -0
  38. basic_report-0.1.0.dist-info/licenses/LICENSE.md +21 -0
@@ -0,0 +1,194 @@
1
+ Metadata-Version: 2.4
2
+ Name: basic-report
3
+ Version: 0.1.0
4
+ Summary: A lightweight Python package for generating clean, professional static HTML reports.
5
+ Keywords: html,report,static,responsive,website
6
+ Author: Björn Scholz
7
+ Author-email: Björn Scholz <bjorn.scholz@gmail.com>
8
+ License-Expression: MIT
9
+ License-File: LICENSE.md
10
+ Classifier: Development Status :: 4 - Beta
11
+ Classifier: Intended Audience :: Developers
12
+ Classifier: Intended Audience :: Science/Research
13
+ Classifier: License :: OSI Approved :: MIT License
14
+ Classifier: Operating System :: POSIX :: Linux
15
+ Classifier: Programming Language :: Python :: 3
16
+ Requires-Dist: jinja2>=3.1.6
17
+ Requires-Dist: loguru>=0.7.3
18
+ Requires-Dist: pandas>=3.0.0
19
+ Requires-Dist: pyyaml>=6.0.3
20
+ Maintainer: Björn Scholz
21
+ Maintainer-email: Björn Scholz <bjorn.scholz@gmail.com>
22
+ Requires-Python: >=3.11
23
+ Project-URL: Homepage, https://basic-report.scholz-and-scholz.com
24
+ Project-URL: Documentation, https://basic-report.scholz-and-scholz.com
25
+ Project-URL: Repository, https://gitlab.com/Nablaquabla/basic-report
26
+ Project-URL: Issues, https://gitlab.com/Nablaquabla/basic-report/-/issues
27
+ Project-URL: Changelog, https://gitlab.com/Nablaquabla/basic-report/-/blob/main/CHANGELOG.md
28
+ Description-Content-Type: text/markdown
29
+
30
+ # Basic Report
31
+ **basic-report** is a lightweight Python package for generating clean, professional static HTML reports with zero
32
+ external dependencies. Built using elements of Bootstrap 4 (MIT licensed) and datatables (MIT licensed), it empowers you
33
+ to create fully self-contained sites that can be served directly by any web server. The focus is set on simplicity - no
34
+ oversized web framework, no database, no setup required.
35
+
36
+ Design any reports entirely in Python using an intuitive top-to-bottom workflow. Simply add elements in the order they
37
+ should appear, and nest them naturally, e.g., tabs within columns, columns within tabs, or any combination you need. The
38
+ API follows the logical flow of your document, making more complex layouts straightforward to build.
39
+
40
+ Perfect for data scientists, analysts, and developers who need to create shareable, standalone reports without the
41
+ overhead of modern web frameworks.
42
+
43
+ ## Quickstart
44
+ ### Installation
45
+
46
+ Install the package from PyPI:
47
+ ```bash
48
+ pip install basic-report
49
+ ```
50
+
51
+ > [!tip]
52
+ > We recommend using [uv](https://github.com/astral-sh/uv) for faster, more reliable dependency management
53
+ >
54
+ > ```bash
55
+ > uv add basic-report
56
+ > ```
57
+
58
+ ### A Minimal Working Example Report
59
+
60
+ The following example demonstrates the minimal setup required to generate a report including a report header:
61
+
62
+ ```python
63
+ from basic_report import Report
64
+
65
+ # Create a new report
66
+ r = Report('output', 'Minimal Working Example', color_mode='light')
67
+ r.add_report_header()
68
+ r.add_text('This is a minimal working example')
69
+
70
+ # Generate the static site
71
+ r.dump()
72
+ ```
73
+
74
+ Executing this script creates the following directory structure:
75
+ ```
76
+ output/
77
+ ├── css_and_scripts/
78
+ └── index.html
79
+ ```
80
+
81
+ Open `index.html` in a web browser to view the report. No build step, compilation process, or server runtime is required.
82
+ The output is a fully self-contained static site ready for distribution.
83
+
84
+ **Next steps**: Follow the tutorial below to explore layouting and additional content or directly head over to the full
85
+ [https://basic-report.scholz-and-scholz.com](full documentation) for a complete overview of available components.
86
+
87
+ ### Building A Proper Report
88
+
89
+ This example demonstrates a ever so slightly more realistic use case, showcasing how you actually stack components to
90
+ build your report.
91
+
92
+ #### Initialize Your Report
93
+ ```python
94
+ import datetime
95
+ from pathlib import Path
96
+ from basic_report import Report
97
+
98
+ report_dir = Path('example_report')
99
+ report_name = 'System Status Report'
100
+ report_date = datetime.date.today()
101
+
102
+ r = Report(
103
+ report_dir,
104
+ report_name,
105
+ report_date,
106
+ color_mode='dark',
107
+ )
108
+ ```
109
+
110
+ #### Add a Professional Header
111
+ Create a dominant header for your report. By default this header not only shows the name of the report, but also the
112
+ date given during initialization. Additionally it also shows a sub-text which tells you when *exactly* the report
113
+ files were created. However, you can easily deactivate the date options as follows:
114
+
115
+ ```python
116
+ r.add_report_header(
117
+ include_date=False,
118
+ include_created_at=False,
119
+ color='steel',
120
+ )
121
+ ```
122
+
123
+ #### Display Structured Status Information
124
+
125
+ Quickly surface critical information with color-coded status sections:
126
+ ```python
127
+ errors = [
128
+ 'Database connection timeout on rnd-server-03'
129
+ ]
130
+ warnings = [
131
+ 'Memory usage reached 75%',
132
+ 'SSL certificate expires in 14 days',
133
+ ]
134
+ info = [
135
+ 'All backups completed successfully'
136
+ ]
137
+
138
+ r.add_error_warning_info_section(errors=errors, warnings=warnings, info=info)
139
+ ```
140
+
141
+ #### Create Multi-Column Layouts
142
+
143
+ Construct responsive, structured layouts using containers such as columns:
144
+
145
+ ```python
146
+ r.add_header('Performance Metrics', color='muffin')
147
+
148
+ r.open_columns()
149
+ r.add_column()
150
+ r.add_text('Align text on the left', align='left')
151
+ r.add_column()
152
+ r.add_text('Align text in the center', color='cherry')
153
+ r.add_column()
154
+ r.add_text('Align text on the right', align='right')
155
+ r.close_columns()
156
+ ```
157
+ **Layout pattern**: Open a container element (e.g., columns, tabs, accordions), add content sequentially, then
158
+ explicitly close the container. The library validates structural consistency and raises descriptive errors if elements
159
+ remain unclosed.
160
+
161
+ #### Create Multi-Page Reports
162
+
163
+ For larger reports, create and manage multiple pages:
164
+
165
+ ```python
166
+ # Create and populate a second page
167
+ r.add_page('page2')
168
+ r['page2'].add_header('Detailed Metrics')
169
+
170
+ # Or set it as active and add content directly
171
+ r.set_current_page('page2')
172
+ r.add_text('Deep dive into performance trends...')
173
+ ```
174
+
175
+ #### Add Navigation Links
176
+
177
+ Link pages to provide intuitive navigation:
178
+
179
+ ```python
180
+ r.add_local_link_to_page('main', '← Back to Overview')
181
+
182
+ r.set_current_page('main')
183
+ r.add_local_link_to_page('page2', 'View Detailed Metrics →')
184
+ ```
185
+
186
+ #### Generate Your Report
187
+ ```python
188
+ r.dump()
189
+ ```
190
+
191
+ The result is a multi-page, self-contained static site with structured layout, responsive design, and integrated
192
+ navigation. Everything generated entirely from Python code.
193
+
194
+ ![Example Report](docs/source/_static/tutorial_report_dark.png)
@@ -0,0 +1,38 @@
1
+ basic_report/__init__.py,sha256=ceLoM7D1Bitz8irxg4y4Kj1ShRaSbZ_QNN871OFSsgQ,319
2
+ basic_report/configs/default.yaml,sha256=Md9rJSKeawjNla5wYsbgcK2paKtb_5eWt3vaSoz4kJM,5084
3
+ basic_report/css_and_scripts/bootstrap.min.css,sha256=YLGeXaapI0_5IgZopewRJcFXomhRMlYYjugPLSyNjTY,155758
4
+ basic_report/css_and_scripts/bootstrap.min.js,sha256=CjSoeELFOcH0_uxWu6mC_Vlrc1AARqbm_jiiImDGV3s,58072
5
+ basic_report/css_and_scripts/dataTables.bootstrap4.min.js,sha256=hJ44ymhBmRPJKIaKRf3DSX5uiFEZ9xB_qx8cNbJvIMU,2085
6
+ basic_report/css_and_scripts/jquery-3.3.1.slim.min.js,sha256=3edrmyuQ0w65f8gfBsqowzjJe2iM6n0nKciPUp8y-7E,69917
7
+ basic_report/css_and_scripts/jquery.dataTables.min.js,sha256=t5ZQTZsbQi8NxszC10CseKjJ5QeMw5NINtOXQrESGSU,82411
8
+ basic_report/css_and_scripts/popper.min.js,sha256=ZvOgfh-ptkpoa2Y4HkRY28ir89u_-VRyDE7sB7hEEcI,21004
9
+ basic_report/page.py,sha256=qAJaJyh_jpTjCJnWqRj0HewrwrQgTtf6S4gTMpGP2xU,31187
10
+ basic_report/report.py,sha256=qCmJ7wA_FRgIQiMx8xRp4laTnVMClsnmPOQsbBFg8O0,15623
11
+ basic_report/templates/accordion.css,sha256=PTzF4YH7yPg6VLHfH3vgbejT-R83Jo_RR84BEHdSS64,616
12
+ basic_report/templates/accordion.html,sha256=H_3SvvXj7LPXmtWmPEom0We7tJ3K76-EUy0A9fQAyqY,598
13
+ basic_report/templates/base.html,sha256=MyKWdZhja4EWfIO7w9OR2UXkGeqMxmPxVxmqwvD66Gg,1665
14
+ basic_report/templates/colors.css,sha256=TPpCGMRz7dGoX7a-W5ye6BIdjjpZ-uDLGFNJEgLvxL4,701
15
+ basic_report/templates/columns.html,sha256=bMw3ldjKeODgBMBFxwqyv9yp65k43fhXGbvMzyGwnAg,165
16
+ basic_report/templates/global_links.html,sha256=ZxZL6nX16enDE2syS9SlJS-OeabvCisa-b5mmkdRyU4,192
17
+ basic_report/templates/header.html,sha256=KXYIK5tSozYCFkIVdk-mCMZQGik2ARRQbZ2v7yFazSM,188
18
+ basic_report/templates/image.html,sha256=QGglJ3LPFxHbrddXCBFM9KEVaUUoBxUxBbP_8U4vQx0,285
19
+ basic_report/templates/list.html,sha256=UjoBSebRuR8ehdebb-K7L3fUubrCXy0KzwAu2KRjFvk,122
20
+ basic_report/templates/navbar.css,sha256=v6UoeMEUGmrLbSMPCw9TBsOf5NKxdI0maCfznXreo84,498
21
+ basic_report/templates/navbar_left.html,sha256=qVbBoVpNUuk21YyhLLrmi7z5mNZq5kxMCzh7GoLfLA0,1045
22
+ basic_report/templates/navbar_right.html,sha256=MXDkkzqtI4b7mfbQQ_wNtLLycvpIa5o7T0yzkmxTZ2Y,1045
23
+ basic_report/templates/navbar_top.html,sha256=qRvF42sACOTUYmToiYH3MSgkDidLdlqbarfCQ7DUew8,821
24
+ basic_report/templates/plot.html,sha256=E5YAypv1myboo8gAA0p0SMQ0ftdo3QMWAE4hlxp01RE,76
25
+ basic_report/templates/report_ball_section.html,sha256=Mzl2ZUSDfFO8yXHe2G4MlSA4PBa3re5ttAt8FFXav1M,2576
26
+ basic_report/templates/report_header.html,sha256=Xkmt8xT1c7KxI4nF7wHSQIr3GqzyNUhJkf_HFBoT-qs,220
27
+ basic_report/templates/site.css,sha256=pEmZCGmm784-Aek6Los3JQuuNsJuRNvXo8lCbOGrgrY,108
28
+ basic_report/templates/sublevel.html,sha256=PfN66cNrWDnzp7FKvjVU3bMeyly186T5Yvb_J2pUN_M,182
29
+ basic_report/templates/table.css,sha256=HRr7JhbyRBdwf0dNgxuSt-wQPK6I7rtdy7LP-tgie-U,1568
30
+ basic_report/templates/table.html,sha256=ndr57BU6AAS_V4PqZoFYqjKxBz6mhm-YyHNI2V6PBa8,1289
31
+ basic_report/templates/tabs.css,sha256=eNNnDzV84PXn1GHNgWBv6Azwk7sZWUj05i6dLFJBwXw,572
32
+ basic_report/templates/tabs.html,sha256=SFzyNXPaAjsKjo4n2g39KAdwA--p6Sh5tEKtqv632xk,826
33
+ basic_report/templates/text.html,sha256=bUnC_opUlA3mbbXUfvbMCyFvWw52JlZbhNxYoTyjy-M,96
34
+ basic_report/utils.py,sha256=MHh0T2n1KcsXKPob4tWsbGmUhkaieOnGks9p1TlRyUc,8492
35
+ basic_report-0.1.0.dist-info/licenses/LICENSE.md,sha256=ME_QKQT2h9WhTZRd5B778qKCcq8tYPNasu3TQm5U4rU,1081
36
+ basic_report-0.1.0.dist-info/WHEEL,sha256=o6xtdofIa8Zz80kUveEHMWeAWtEyZSzYS1bbyKDCgzA,80
37
+ basic_report-0.1.0.dist-info/METADATA,sha256=1HUIv7d-JnwgGujqWRGSzVK95faVlWmE2YMYsrLdgFg,6247
38
+ basic_report-0.1.0.dist-info/RECORD,,
@@ -0,0 +1,4 @@
1
+ Wheel-Version: 1.0
2
+ Generator: uv 0.10.4
3
+ Root-Is-Purelib: true
4
+ Tag: py3-none-any
@@ -0,0 +1,21 @@
1
+ MIT License
2
+ -----------
3
+ Copyright (c) 2026 Björn Scholz
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.