smd-reports
Report template revisions:
Render JSON reports as standalone HTML and PDF with shared layouts, configurable branding and Swedish/English labels. Use a neutral default theme or choose a built-in preset.
Build reports from JSON. Define columns once and supply values as row lists. HTML includes its CSS, print rules, fonts and artwork, so it can be converted elsewhere with WeasyPrint. Use compact wrapping tables for gene and haplotype lists, or highlight selected result rows. Choose preset/custom paper sizes, attach plots to sections, and format summaries, descriptions and references as plain text or Markdown.
Report workflow
The development and release workflow and documentation publishing workflow are described in the contribution guide.
Install
Requires Python 3.10 or newer. Install with pip:
python -m pip install smd-reports
# Include the optional PDF renderer:
python -m pip install "smd-reports[pdf]"
The distribution name is smd-reports; the Python import name is smd_reports.
PDF rendering also requires native Pango libraries. See installation.
Use from Python
from pathlib import Path
from smd_reports import ReportLoader, ReportRenderer
report = ReportLoader().load("report.json")
renderer = ReportRenderer()
Path("report.html").write_text(renderer.render_html(report), encoding="utf-8")
# Requires the PDF extra:
Path("report.pdf").write_bytes(renderer.render_pdf(report))
Load JSON text with ReportLoader().loads(json_text) or files with load(path).
The Python guide and quickstart include examples.
Custom columns and detail fields are configured in JSON, including English/Swedish labels.
Group column labels by language and supply values in the same order:
{
"columns": {
"en": ["Gene", "Copy number"],
"sv": ["Gen", "Kopietal"]
},
"rows": [["EXAMPLE", 6]]
}
Optional column_options configures widths and formatting by column index.
Placeholders such as <PATIENT_NAME> remain visible in HTML and PDF output; see
placeholder values and replacement.
Use from the command line
smd-reports validate report.json
smd-reports render report.json --format html --output report.html
smd-reports render report.json --format pdf --output report.pdf
smd-reports normalize report.json --output report.portable.json
smd-reports schema --output report.schema.json
The same commands are available with python -m smd_reports.
Documentation
Read the documentation for installation, Python usage, JSON inputs and rendering.
- Overview, installation and quickstart
- Python usage and Python API reference
- Report examples and presets, JSON format and Command-line reference
- Center branding and HTML/PDF rendering
- Contributing, testing and releases and changelog
The GitHub wiki mirrors the documentation.
Runnable synthetic examples and complete JSON inputs are in examples/.
Example reports
| Preset | HTML | Input | |
|---|---|---|---|
| Generic | HTML | JSON | |
| Coyote3 | HTML | JSON | |
| Genexus | HTML | JSON | |
| CLL Genie | HTML | JSON | |
| PGxModule | HTML | JSON |
These reports use synthetic clinical data and generic application, center and accreditation placeholders. Production reports use the artwork supplied through JSON. Download HTML files and open them locally; CSS, fonts and artwork are embedded. PDFs can be previewed directly in GitHub.
License
Copyright (C) 2026 Ram Nanduri.
GPL-3.0-only. Embedded Source Sans 3 fonts use the SIL Open Font License.
Metadata
Release files for smd-reports 0.2.1
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 | Actions |
|---|---|---|---|---|
| smd_reports-0.2.1.tar.gz | 2.7 MB | With provenance | Details for smd_reports-0.2.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| smd_reports-0.2.1-py3-none-any.whl | Python 3 | none | any | Details for smd_reports-0.2.1-py3-none-any.whl |
Total release size: 3.2 MB
Release files / smd_reports-0.2.1.tar.gz
| Download URL | smd_reports-0.2.1.tar.gz |
|---|---|
| Size | 2.7 MB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
ae53dd5b493acb41cea1ed4a4aa42e1eeb0e678866c7d53aa85c35647b71131c
|
|
BLAKE2b-256 checksum How to use checksums |
f9899b69504ffbbb82da84ff55ee1ff44d9dae3c49bb10a75a315f4fb28ec476
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 9, 2026.
Transparency logRelease files / smd_reports-0.2.1-py3-none-any.whl
| Download URL | smd_reports-0.2.1-py3-none-any.whl |
|---|---|
| Size | 455.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
624c19d7c86b15b97bc56f92054a09b3f03ce398ac1e9a1e724bdec47040f1f8
|
|
BLAKE2b-256 checksum How to use checksums |
e03e46802c3f8240b73e7b4b8d3d3ac7d61326def03a189bd0a137de43b2c38f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 9, 2026.
Transparency logSecurity for smd-reports 0.2.1
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.
Full provenance
Both files in this release have been uploaded with provenance metadata.
Attestation for smd_reports-0.2.1.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 9, 2026.
Transparency logA 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.