No project description provided
Project description
Library for config-based rendering tables to html or excel
Allows to create a config based on pydantic BaseModel:
from bmsdna.table_rendering import markdown_to_excel, ColumnConfig, TableRenderer
my_cols = [
ColumnConfig(header_key="mail.date", field="start", format="datetime"),
ColumnConfig(
header="MyTool",
align="left",
field="customer_id",
link=lambda _, c: some_tool_link(c.get("customer_id"), c.get("lng_code")),
),
ColumnConfig(
header="PDF",
align="left",
field="customer_id",
link=lambda _, c: maybe_some_pdf_link(c.get("customer_id"), c.get("lng_code")),
),
ColumnConfig(
header_key="mail.subject",
field="subject",
),
ColumnConfig(
header_key="customer.sales_l12m",
field="sales_amount_l12m",
format="float",
format_nr_decimals=0,
)
]
lng_code = "de"
lng_table_config = TableRenderer(
my_cols,
translator=lambda k, d: get_app_text(k, lng_code, d),
)
# we can make some html
html:str = lng_table_config.render_html(some_list_data)
# or also an excel
with xlsxwriter.Workbook() as wb:
ws = ws.add_worksheet("sheet1")
# we can also write some markdown to excel
markdown_to_excel("# Ein Titel\nWir haben hier einen Text", ws, wb)
# and add the table to it
lng_table_config.render_into_sheet(some_list_data, ws, wb, offset_rows=10)
We use it internally to create Emails with Excel attachments
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file bmsdna_table_rendering-0.5.0.tar.gz.
File metadata
- Download URL: bmsdna_table_rendering-0.5.0.tar.gz
- Upload date:
- Size: 30.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
79ea16d98aeda38e70e470d1fbccb279629ebeb2e0efb16ce79857def3a9834f
|
|
| MD5 |
74abb9d6c64276ff2ac01667c2b338d4
|
|
| BLAKE2b-256 |
abf09a6e69e18717883b5bdbaad8af4629ceaf57b336cb1996c1cfc9d0cd516b
|
Provenance
The following attestation bundles were made for bmsdna_table_rendering-0.5.0.tar.gz:
Publisher:
python-publish.yml on bmsuisse/bmsdna.table_rendering
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
bmsdna_table_rendering-0.5.0.tar.gz -
Subject digest:
79ea16d98aeda38e70e470d1fbccb279629ebeb2e0efb16ce79857def3a9834f - Sigstore transparency entry: 194338389
- Sigstore integration time:
-
Permalink:
bmsuisse/bmsdna.table_rendering@f699392e6af53033ca80a13befd7cf44e0928d18 -
Branch / Tag:
refs/tags/v0.5.0 - Owner: https://github.com/bmsuisse
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-publish.yml@f699392e6af53033ca80a13befd7cf44e0928d18 -
Trigger Event:
release
-
Statement type:
File details
Details for the file bmsdna_table_rendering-0.5.0-py3-none-any.whl.
File metadata
- Download URL: bmsdna_table_rendering-0.5.0-py3-none-any.whl
- Upload date:
- Size: 13.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
72eb29ea061be7f8c4ddc6d12c884b4c0d61e80b014eb7916370d25e068ce749
|
|
| MD5 |
20ef977af3e676c9af26cf7c39ce337e
|
|
| BLAKE2b-256 |
a4ba9187234f2d0f6e2c7f6df6575444d53f71c477cfc872ef65af1fccbea78c
|
Provenance
The following attestation bundles were made for bmsdna_table_rendering-0.5.0-py3-none-any.whl:
Publisher:
python-publish.yml on bmsuisse/bmsdna.table_rendering
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
bmsdna_table_rendering-0.5.0-py3-none-any.whl -
Subject digest:
72eb29ea061be7f8c4ddc6d12c884b4c0d61e80b014eb7916370d25e068ce749 - Sigstore transparency entry: 194338399
- Sigstore integration time:
-
Permalink:
bmsuisse/bmsdna.table_rendering@f699392e6af53033ca80a13befd7cf44e0928d18 -
Branch / Tag:
refs/tags/v0.5.0 - Owner: https://github.com/bmsuisse
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-publish.yml@f699392e6af53033ca80a13befd7cf44e0928d18 -
Trigger Event:
release
-
Statement type: