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. 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. 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
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.1.2

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.1.2
File Size Uploaded Provenance Actions
smd_reports-0.1.2.tar.gz 2.7 MB With provenance Details for smd_reports-0.1.2.tar.gz

Built distribution (wheel)

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

Total release size: 3.1 MB

Release files / smd_reports-0.1.2.tar.gz

Download URL smd_reports-0.1.2.tar.gz
Size 2.7 MB
Tags Source
SHA-256 checksum
How to use checksums
004a5ec309526eae28b4e0130e35674a4a4b8a7cb829e1347477d0c99e0c5b0e
BLAKE2b-256 checksum
How to use checksums
edb3e165af3c09722a375137e0d0a6461256cf9472785164c8db1bea5846ede9
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 log

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

Download URL smd_reports-0.1.2-py3-none-any.whl
Size 452.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
ec92baf7020a1bb70d3b49287ca6407197bca4f992330de315d811f3489fe506
BLAKE2b-256 checksum
How to use checksums
e9b99da6b18cbec2dc5c742fbd63ce42517e089b9131eadfec32b4256435ed6a
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 log

Security for smd-reports 0.1.2

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.1.2.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 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