Skip to content

Quickstart

github-actions[bot] edited this page Nov 10, 2026 · 3 revisions

Quickstart

Install the package:

python -m pip install smd-reports

Save this as report.json:

{
  "title": "Example Report",
  "language": "en",
  "report": {
    "report_id": "DEMO-001",
    "generated_at": "2026-01-01T12:00:00Z"
  },
  "sections": [
    {
      "kind": "table",
      "key": "results",
      "columns": {
        "en": ["Measure", "Value"],
        "sv": ["Mått", "Värde"]
      },
      "rows": [
        [
          "Example A",
          12
        ]
      ],
      "heading": "Results"
    },
    {
      "kind": "summary",
      "key": "summary",
      "text": "Synthetic demonstration.",
      "heading": "Conclusion"
    }
  ]
}

Omitting preset selects neutral defaults. Set theme and layout independently as needed; existing application selectors remain supported. sample_id is optional. Choose a preset when you want a different report identity.

Validate and render:

smd-reports validate report.json
smd-reports render report.json --format html --output report.html

Open report.html in a browser. For PDF:

python -m pip install "smd-reports[pdf]"
smd-reports render report.json --format pdf --output report.pdf

See installation for native PDF dependencies, Python usage for imports and JSON inputs for additional columns, translations, logos and detailed sections.

Clone this wiki locally