BakePy
Create good-looking documents programatically and easily
BakePy was conceived as an way to create good-looking documents in Python without messing with templates or difficult layout systems.
Creating a BakePy Report is simple:
import pandas as pd
from datetime import datetime as dt
from bakepy import Report
r = Report()
r.recipe("title", "Example BakePy Report")
r.recipe("markdown",
f"""
### {dt.now().strftime("%Y-%m-%d")}
""")
#We want to center text in the current column.
r.set_col_cls("text-center")
#A separator
r.recipe("separator")
#Some variables
a = 4
color = "blue"
l = ["red", 3, False]
#Replacing variables in generated text.
r.recipe("markdown",
f"""
We can add markdown and use the power of Python to mix:
- Variables, like a={a}
- Conditional formatting, like adding the <span style="color:{color}">color {color}</span>
- And even directly transform Python objects beyond things like the list: {l}
"""
)
#Now we add some more text, this time in the same row we were at before.
r.add("<h2> See some examples below! </h2>", new_row = False)
#We can even add items to the same column!
r.recipe("spacer", level = 3, new_col = False)
r.add(
"""
For example, Pandas Dataframes and Matplotlib Figures
""", new_col = False)
#Adding a DataFrame in a new line.
data = {
"cost": [10, 23, 40],
"gain": [20, 40, 45]
}
df = pd.DataFrame(data)
r.add(df, caption = "This is a table")
#We set row items to be aligned at the center.
r.set_row_cls("align-items-center")
#Adding a plot on the same line.
r.add(df.plot(x="cost", y="gain"), size=6, caption = "This is a figure", new_row=False)
#Saving the report
#An image
r.recipe("img",
"https://upload.wikimedia.org/wikipedia/en/thumb/8/80/Wikipedia-logo-v2.svg/800px-Wikipedia-logo-v2.svg.png",
size = 2,
caption = "Adding an image from the Internet.")
r.save_html("example_report.html")
Simple to use, easy to hack
BakePy is designed to automatically transform Python objects such as Matplotlib Figures and Pandas DataFrames into HTML code. By using Bootstrap 5's grid you can easily arrange markup, mathematical formulas, plots and tables without needing boilerplate code.
If you need more customization, you can easily add CSS stylesheets in order to make the Report look exactly how you want it to.
Metadata
Release files for bakepy 0.0.11
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| bakepy-0.0.11.tar.gz | 14.6 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| bakepy-0.0.11-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 31.0 kB
Release files / bakepy-0.0.11.tar.gz
| Download URL | bakepy-0.0.11.tar.gz |
|---|---|
| Size | 14.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
00fdbfd3388704a70cb374d361bf7dc46dafdb9487ffdcbaf90c73b31b99a35f
|
|
BLAKE2b-256 checksum How to use checksums |
eced2e08ef7dc0c9fe8cdaefcc91c6b7ebd77eee5c0e6d3e3e3780d749c194f0
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
python-httpx/0.23.0
|
Release files / bakepy-0.0.11-py3-none-any.whl
| Download URL | bakepy-0.0.11-py3-none-any.whl |
|---|---|
| Size | 16.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
cfe0241a56ebe67de677c64e935f015734afb8659abe093f0e2c2627fc8a465f
|
|
BLAKE2b-256 checksum How to use checksums |
8937e9d13112ea74043a1205b9a174b1d3cad2595d32af285e79a8822170bf0b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
python-httpx/0.23.0
|
Security for bakepy 0.0.11
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.