prisma-flow

Lightweight PRISMA-style flow diagrams for evidence synthesis workflows.

prisma-flow

prisma-flow is a lightweight Python package for generating PRISMA-style flow diagrams for systematic reviews, scoping reviews, evidence syntheses, and literature review workflows.

PRISMA refers to the Preferred Reporting Items for Systematic reviews and Meta-Analyses reporting guideline. prisma-flow is an independent Python implementation for generating PRISMA-style flow diagrams; it is not the PRISMA guideline itself. See PRISMA acknowledgement and references for original publications and official resources.

The default output is SVG rendered with pure Python. There are no required system-level layout or rendering tools.

Pure Python SVG

Generate stable, template-based diagrams without Graphviz, Cairo, Node, Mermaid CLI, browser engines, Matplotlib, or Plotly.

Multiple outputs

Export SVG, standalone HTML, Mermaid text, PNG, and JSON with the base installation. YAML is available as an optional extra.

PRISMA-aware validation

Validate count relationships and receive structured errors and warnings before rendering a diagram.

API and CLI

Use PrismaFlow in Python code or run prisma-flow render from the command line.

Minimal example

from prismaflow import new_review

flow = new_review(
    records_identified_databases=1240,
    records_identified_registers=50,
    records_removed_duplicates=210,
    records_removed_automation=0,
    records_removed_other=0,
    records_screened=1080,
    records_excluded=950,
    reports_sought=130,
    reports_not_retrieved=10,
    reports_assessed=120,
    reports_excluded={
        "Wrong population": 30,
        "Wrong intervention": 20,
        "Wrong outcome": 15,
        "Not primary research": 15,
    },
    studies_included=40,
    reports_included=40,
)

flow.to_svg("prisma.svg")

Command-line example

prisma-flow render examples/basic_new_review.json -o prisma.svg

Why template-based diagrams?

PRISMA flow diagrams are structured reporting documents, not arbitrary graphs. prisma-flow uses fixed PRISMA templates and a small layout engine so output is predictable and easy to reproduce in research workflows.

The implemented templates are based on the official PRISMA 2020 flow diagram templates. Please cite the PRISMA 2020 statement and explanation/elaboration papers when using PRISMA-style diagrams in scholarly outputs, and cite prisma-flow as software when it is used to generate your diagrams.