Skip to main content

Turn Python-defined pipeline graphs into presentation-ready SVG and PNG diagrams.

Project description

frameplot

PyPI version Python versions CI License

Turn Python-defined pipeline graphs into presentation-ready SVG and PNG diagrams.

한국어 README

frameplot hero image

frameplot is a compact Python library for rendering left-to-right pipeline diagrams with clean defaults. Define nodes, edges, groups, and optional detail panels in plain Python, then export polished SVG for documentation or high-resolution PNG for slides and papers.

Theme Gallery

All built-in presets stay on a white canvas. The same hero pipeline is rendered below once per theme so you can compare them directly.

Soft Retro Retro
Soft Retro theme hero Retro theme hero
Research Dark
Research theme hero Dark theme hero
Cyberpunk Monochrome
Cyberpunk theme hero Monochrome theme hero

Why frameplot?

  • Clean and Professional: Left-to-right architecture diagrams with modern defaults.
  • Diagram as Code: Define your pipeline in Python, get deterministic SVG/PNG outputs.
  • Detail Panels: Unique feature to expand a summary node into a lower inset mini-graph for deep dives.
  • Deep Customization: Fine-tune typography, spacing, colors, and corner radii via Theme.
  • White-Canvas Themes: Built-in presets stay presentation-friendly on white backgrounds.
  • Presentation Ready: High-quality SVG for web/docs and PNG for slides or papers.

Install

python -m pip install frameplot

PNG export depends on CairoSVG and may require Cairo or libffi packages from the host OS.

Quickstart

from frameplot import Edge, Group, Node, Pipeline

pipeline = Pipeline(
    nodes=[
        Node("start", "Start", "Receive request"),
        Node("fetch", "Fetch Data", "Load source tables"),
        Node("retry", "Retry", "Loop on transient failure", fill="#FFF2CC"),
        Node("done", "Done", "Return result", fill="#D9EAD3"),
    ],
    edges=[
        Edge("e1", "start", "fetch"),
        Edge("e2", "fetch", "retry", dashed=True),
        Edge("e3", "retry", "fetch", color="#C0504D"),
        Edge("e4", "fetch", "done"),
    ],
    groups=[
        Group("g1", "Execution", ["start", "fetch", "retry"], edge_ids=["e2"]),
    ],
)

svg = pipeline.to_svg()
pipeline.save_svg("pipeline.svg")
pipeline.save_png("pipeline.png")

Quickstart result

Edge-to-Edge Joins

from frameplot import Edge, Node, Pipeline

pipeline = Pipeline(
    nodes=[
        Node("source", "Source", "Primary request"),
        Node("worker", "Worker", "Prepare response"),
        Node("audit", "Audit", "Write side log", fill="#DBEAFE"),
        Node("done", "Done", "Return result", fill="#D9EAD3"),
    ],
    edges=[
        Edge("e1", "source", "worker"),
        Edge("e2", "worker", "done"),
        Edge("e3", "audit", "e2", merge_symbol="+", color="#2563EB"),
    ],
)

Edge join result

Public API

Top-level imports are the supported public API:

  • Node(id, title, subtitle=None, fill=None, stroke=None, text_color=None, metadata=None, width=None, height=None)
  • Edge(id, source, target, color=None, dashed=False, merge_symbol=None, metadata=None)
  • Group(id, label, node_ids, edge_ids=(), stroke=None, fill=None, metadata=None)
  • DetailPanel(id, focus_node_id, label, nodes, edges, groups=(), stroke=None, fill=None, metadata=None)
  • Theme(...)
  • Pipeline(nodes, edges, groups=(), detail_panel=None, theme=None)

Edge.target may reference either a node id or another edge id. When targeting another edge, merge_symbol="+" or "x" renders a join badge at the merge point.

Pipeline exposes:

  • to_svg() -> str
  • save_svg(path) -> None
  • to_png_bytes(scale=4.0) -> bytes
  • save_png(path, scale=4.0) -> None

Advanced Example: Multi-cloud Data Pipeline

The hero image at the top and the theme gallery above are generated from examples/theme_heroes.py, using the shared pipeline definition in examples/hero_pipeline.py. Together they showcase:

  • Complex Routing: Seamlessly connecting AWS (S3/Lambda) to GCP (Pub/Sub/Dataflow) services.
  • Contextual Details: Using a DetailPanel to explain the internal Spark Job Pipeline of the "Dataflow" node.
  • Soft Retro Styling: Applying the built-in Theme.soft_retro() preset on a white canvas.

Design Notes

  • Layout is intentionally left-to-right in v0.x.
  • Edge labels are not supported yet, but edge-to-edge joins can render optional + / x badges.
  • Groups stay visual overlays, and routes leaving or re-entering grouped nodes bend outside grouped areas.
  • Detail panels render as separate lower insets attached to a focus node in the main flow.

Development

python -m venv .venv
source .venv/bin/activate
python -m pip install -e '.[dev]'
python -m pytest -q

Release publishing is automated through GitHub Actions and PyPI Trusted Publishing. Bump the version in pyproject.toml, create a tag like v0.4.0, and push the tag to trigger a release from .github/workflows/workflow.yml.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

frameplot-0.5.3.tar.gz (60.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

frameplot-0.5.3-py3-none-any.whl (50.5 kB view details)

Uploaded Python 3

File details

Details for the file frameplot-0.5.3.tar.gz.

File metadata

  • Download URL: frameplot-0.5.3.tar.gz
  • Upload date:
  • Size: 60.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for frameplot-0.5.3.tar.gz
Algorithm Hash digest
SHA256 fa890f5a9bc43536924dd60534c8cf5a4ca9ee8b989243ac01a5b48a0c703567
MD5 54345828b3e427b61f28ccb2fe4c1c24
BLAKE2b-256 e2ad764f3f42c8d46ead866dd34a3ad6f2fe6d21021d67f1242f29bdb193deff

See more details on using hashes here.

Provenance

The following attestation bundles were made for frameplot-0.5.3.tar.gz:

Publisher: workflow.yml on smturtle2/frameplot

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file frameplot-0.5.3-py3-none-any.whl.

File metadata

  • Download URL: frameplot-0.5.3-py3-none-any.whl
  • Upload date:
  • Size: 50.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for frameplot-0.5.3-py3-none-any.whl
Algorithm Hash digest
SHA256 61799c05071bfed3060dde683589b8099e7f6ae04c66fd97c53abfea67c50a9a
MD5 d582916db4209db889dc60c2d918bc9f
BLAKE2b-256 a03748ca1fbd22d44dcebb0ce5c0e9ae9deba5f3a8c352c9a1100ea3b2d96f82

See more details on using hashes here.

Provenance

The following attestation bundles were made for frameplot-0.5.3-py3-none-any.whl:

Publisher: workflow.yml on smturtle2/frameplot

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page