Turn Python-defined pipeline graphs into presentation-ready SVG and PNG diagrams.
Project description
frameplot
Turn Python-defined pipeline graphs into presentation-ready SVG and PNG diagrams.
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 PNG for slides and papers.
Why frameplot?
- Clean left-to-right layout for architecture diagrams, data pipelines, and model overviews
- SVG-first output with optional PNG export through CairoSVG
- Detail panels for expanding a summary node into a lower inset mini-graph
- Themeable typography, spacing, colors, and routing defaults
- Deterministic rendering from simple dataclass-based inputs
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")
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, 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)
Pipeline exposes:
to_svg() -> strsave_svg(path) -> Noneto_png_bytes() -> bytessave_png(path) -> None
Advanced Example
The hero image above is generated from examples/sar_backbone_example.py, which demonstrates:
- custom
Themevalues - split decoder branches
- grouped overlays
- a
DetailPanelattached to a summary node
Design Notes
- Layout is intentionally left-to-right in v0.x.
- Edge labels are not supported yet.
- Groups are visual overlays and do not constrain layout.
- 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.1.0, and push the tag to trigger a release from .github/workflows/workflow.yml.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file frameplot-0.1.0.tar.gz.
File metadata
- Download URL: frameplot-0.1.0.tar.gz
- Upload date:
- Size: 27.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
13315522a29c0c2ad536e294e0497c0e5a87969f5f1d7a87ef1df9cdfab86380
|
|
| MD5 |
a41592a933c62e007bcf05853b8e6864
|
|
| BLAKE2b-256 |
9830f1b2f87855b2cae8b011634a2d4d255b547e22e0aa42eef3924f77077076
|
Provenance
The following attestation bundles were made for frameplot-0.1.0.tar.gz:
Publisher:
workflow.yml on smturtle2/frameplot
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
frameplot-0.1.0.tar.gz -
Subject digest:
13315522a29c0c2ad536e294e0497c0e5a87969f5f1d7a87ef1df9cdfab86380 - Sigstore transparency entry: 1271008255
- Sigstore integration time:
-
Permalink:
smturtle2/frameplot@9d8547b320d7a70e8bb7a7aeb0e0344ad34ca53a -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/smturtle2
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
workflow.yml@9d8547b320d7a70e8bb7a7aeb0e0344ad34ca53a -
Trigger Event:
push
-
Statement type:
File details
Details for the file frameplot-0.1.0-py3-none-any.whl.
File metadata
- Download URL: frameplot-0.1.0-py3-none-any.whl
- Upload date:
- Size: 27.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5e5284356b35f86faeab28d03e585cde8274f0b0d20bffb0776dee3022caa8ca
|
|
| MD5 |
a80ecf6b0ef9efa54b1c2cc1b3f8f4a6
|
|
| BLAKE2b-256 |
7bb472d8f68c9a2bc785a940e86bab0e2601acc03503f46bab8a512b8b7bcc0a
|
Provenance
The following attestation bundles were made for frameplot-0.1.0-py3-none-any.whl:
Publisher:
workflow.yml on smturtle2/frameplot
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
frameplot-0.1.0-py3-none-any.whl -
Subject digest:
5e5284356b35f86faeab28d03e585cde8274f0b0d20bffb0776dee3022caa8ca - Sigstore transparency entry: 1271008294
- Sigstore integration time:
-
Permalink:
smturtle2/frameplot@9d8547b320d7a70e8bb7a7aeb0e0344ad34ca53a -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/smturtle2
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
workflow.yml@9d8547b320d7a70e8bb7a7aeb0e0344ad34ca53a -
Trigger Event:
push
-
Statement type: