Skip to main content

smd-reports

smd-reports logo

Python Package version CI Documentation PDF renderer License

Report template revisions:

Generic template Coyote3 DNA template Coyote3 RNA template Genexus template CLL Genie template PGx template

Render JSON reports as standalone HTML and PDF with shared layouts, configurable branding and Swedish/English labels. Select themes and layouts independently, or use a built-in preset.

See the configuration reference for all supported settings and defaults.

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 tables for gene and haplotype lists: short lists keep their measured width, while multi-row panels use equal-width cells across the report. 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

JSON input to HTML and PDF 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.

The GitHub wiki mirrors the documentation.

Runnable synthetic examples and complete JSON inputs are in examples/.

Example reports

Preset HTML PDF Input
Generic HTML PDF JSON
Custom presentation HTML PDF JSON
Coyote3 HTML PDF JSON
Genexus HTML PDF JSON
CLL Genie HTML PDF JSON
PGxModule HTML PDF 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.5.3

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

Source distribution (sdist)

Source distribution for smd-reports 0.5.3
File Size Uploaded Provenance Actions
smd_reports-0.5.3.tar.gz 5.2 MB With provenance Details for smd_reports-0.5.3.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for smd-reports 0.5.3
File Interpreter ABI Platform Actions
smd_reports-0.5.3-py3-none-any.whl Python 3 none any Details for smd_reports-0.5.3-py3-none-any.whl

Total release size: 5.9 MB

Release files / smd_reports-0.5.3.tar.gz

Download URL smd_reports-0.5.3.tar.gz
Size 5.2 MB
Tags Source
SHA-256 checksum
How to use checksums
de552eccb3fcb19f38999f7689a916718ce1754945966f53aa6a082b8b7e4625
BLAKE2b-256 checksum
How to use checksums
ef0146ad0ad108f8206b9ae70a06cac46d2d9f9dbeeec33c64ae4b8f1e50737d
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 11, 2026.

Transparency log

Release files / smd_reports-0.5.3-py3-none-any.whl

Download URL smd_reports-0.5.3-py3-none-any.whl
Size 746.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
aae183f47b3f0b1b877530ac50f5be0d4c8034e9e14b82b37e38c759db16bc1a
BLAKE2b-256 checksum
How to use checksums
4e4261fdb5528cf1f1d759a2b8cf47aaedb05dea87e4d189bee50377810e11f6
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 11, 2026.

Transparency log

Security for smd-reports 0.5.3

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.

Select from 2 files

Attestation for smd_reports-0.5.3.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 11, 2026.

Transparency log

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