Skip to main content

CardReport

Latest release PyPI version

What’s new

Build static reports in Python from cards, KPIs, charts and tables. Compose a report, then get standalone HTML or PDF bytes for your application. PDF text is selectable and charts are vector graphics.

Install in your project

Python 3.12+ is required. Install from PyPI with uv, then install the PDF browser runtime:

uv add "cardreport[pdf]"
uv run python -m playwright install chromium

Keep your application’s uv.lock to pin the installed version. For HTML-only use, omit [pdf] and the browser-install command. See installation and quickstart for local checkouts, wheels and how to embed exports.

Use from Python

from cardreport import BarChart, Card, KPI, Report

report = Report("Call results")
report.add(Card(KPI("Total calls", 34)))
report.row(
    Card(BarChart(labels=["Answered", "No answer"], values=[24, 10])),
    height_mm=70,
)

html: str = report.to_html()
pdf: bytes = report.to_pdf()

Return pdf from your application, put it in storage, or use report.write_pdf("report.pdf") to save a file. Existing files are preserved by default. Reports reject content that does not fit rather than silently shrinking it.

Documentation

Chromium is the default renderer. The experimental SVG/WeasyPrint renderer works without JavaScript or a browser, with a smaller supported feature set. Both can render the original reference example. Local macOS/Python 3.12 is verified; Linux and Windows are not yet verified.

For architecture, decisions and contributing, see project documentation.

License

MIT. Bundled DejaVu fonts retain their font license. Third-party rendering packages retain their own licenses.

See language and display formats for report language tags, custom dates, number precision and the Spanish example.

Metadata

Release files for cardreport 0.3.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for cardreport 0.3.0
File Size Uploaded Provenance Actions
cardreport-0.3.0.tar.gz 1.0 MB Without provenance Details for cardreport-0.3.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for cardreport 0.3.0
File Interpreter ABI Platform Actions
cardreport-0.3.0-py3-none-any.whl Python 3 none any Details for cardreport-0.3.0-py3-none-any.whl

Total release size: 1.8 MB

Release files / cardreport-0.3.0.tar.gz

Download URL cardreport-0.3.0.tar.gz
Size 1.0 MB
Tags Source
SHA-256 checksum
How to use checksums
7068223c59861fbefcb417c67a4f548ac752598b61545293110b223ef38a9802
BLAKE2b-256 checksum
How to use checksums
c211be5f19574cd9df1da3399d08b4afa779dc7ecf3264fb79d08246af9c7cd7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.10.6 {"installer":{"name":"uv","version":"0.10.6","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / cardreport-0.3.0-py3-none-any.whl

Download URL cardreport-0.3.0-py3-none-any.whl
Size 782.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
d48ffed17c60709a78d4fbdd7eb6f816960510bafa2d9c4d08628bea9d62f4ef
BLAKE2b-256 checksum
How to use checksums
fccc5fb26c7bced0386c6a9bb4c14c3487af936afb5098be10c20107a2328fd7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.10.6 {"installer":{"name":"uv","version":"0.10.6","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Security for cardreport 0.3.0

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.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page