Skip to main content

A Python wrapper for ReactFlow using AnyWidget - build interactive node graphs without JavaScript

Project description

PyNodeWidget

A Python wrapper for ReactFlow using AnyWidget - build interactive node graphs without JavaScript.

Quick Start

from pynodewidget import NodeFlowWidget
from pynodewidget.grid_layouts import create_three_column_grid
from pynodewidget.models import ButtonHandle, NumberField, LabeledHandle, TextField

widget = NodeFlowWidget()

grid_layout = create_three_column_grid(
    left_components=[
        LabeledHandle(id="input", handle_type="input")
    ],
    center_components=[
        NumberField(id="value", value=50, min=0, max=100),
        TextField(id="name", value="Processor")
    ],
    right_components=[
        LabeledHandle(id="output", handle_type="output")
    ]
)

widget.add_node_type(
    type_name="processor",
    label="Processor",
    icon="⚙️",
    grid_layout=grid_layout
)
widget

Demo

Demo

Features

  • Interactive Node Graphs: Build visual workflows with drag-and-drop nodes
  • No JavaScript Required: Pure Python API for defining node types and layouts
  • JSON Schema Integration: Automatically generate node UIs from JSON schemas
  • Static HTML Export: Export workflows as standalone HTML files for documentation and sharing
    • Interactive or view-only modes
    • Self-contained files that work without Python/Jupyter
    • Perfect for visualizing DAGs and data pipelines
  • Jupyter & Marimo Support: Works seamlessly in Jupyter notebooks and Marimo apps
  • Flexible Layouts: Customizable grid-based node layouts with various components
  • Type-Safe: Built with Pydantic for robust type validation

Export Workflows

# Export as standalone HTML (no Python required to view)
widget.export_html("workflow.html", interactive=True)

# Export as JSON for persistence
widget.export_json("workflow.json")

Development

Requires:

  • Python 3.12+ (uv)
  • Bun for JavaScript bundling
# Install dependencies
uv venv
uv pip install -e .[all]

task

Documentation

# Serve documentation locally with live reload
task docs-serve

# Build static documentation
task docs-build

See full documentation at the project's GitHub Pages or run locally.

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

pynodewidget-0.2.2.tar.gz (2.0 MB view details)

Uploaded Source

Built Distribution

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

pynodewidget-0.2.2-py3-none-any.whl (726.6 kB view details)

Uploaded Python 3

File details

Details for the file pynodewidget-0.2.2.tar.gz.

File metadata

  • Download URL: pynodewidget-0.2.2.tar.gz
  • Upload date:
  • Size: 2.0 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for pynodewidget-0.2.2.tar.gz
Algorithm Hash digest
SHA256 0329a2fd451076b09024d9b52a8e71b0248d5ac5bbedf3ea227cae05079d6dd2
MD5 0cca4fda160fa7d33cdb13902b4c845d
BLAKE2b-256 be9ea355987a25af764f3978019fb0390d3a748fa9725db7b0bf7c712a1cfc67

See more details on using hashes here.

Provenance

The following attestation bundles were made for pynodewidget-0.2.2.tar.gz:

Publisher: publish.yml on HenningScheufler/pynodewidget

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

File details

Details for the file pynodewidget-0.2.2-py3-none-any.whl.

File metadata

  • Download URL: pynodewidget-0.2.2-py3-none-any.whl
  • Upload date:
  • Size: 726.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for pynodewidget-0.2.2-py3-none-any.whl
Algorithm Hash digest
SHA256 97fee5bd66e852eae8552d8a5003026d304b998f9fb93130c60828789fcb6047
MD5 57fdf8abf9e4e15a563de6e51283ba11
BLAKE2b-256 cc69e374eafbb15657e8dcbb1def00b91532672951b291df131a2ff46ee176b1

See more details on using hashes here.

Provenance

The following attestation bundles were made for pynodewidget-0.2.2-py3-none-any.whl:

Publisher: publish.yml on HenningScheufler/pynodewidget

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