Skip to main content

pipen-diagram

Draw pipeline diagrams for pipen.

Features

  • Diagram theming
  • Hiding processes from diagram

Configurations

  • diagram_theme: The name of the theme to use, or a dict of a custom theme.
  • diagram_loglevel: The log level of the diagram
  • diagram_savedot: Whhether to save the dot file (for debugging purpose)
  • diagram_hide: Process-level item, whether to hide current process from the diagram

Installation

pip install -U pipen-diagram

Enabling/Disabling the plugin

The plugin is registered via entrypoints. It's by default enabled. To disable it: plugins=[..., "no:diagram"], or uninstall this plugin.

Usage

example.py

from pipen import Proc, Pipen, ProcGroup


class A(Proc):
    """Process A"""
    input = "a"


class B(Proc):
    """Process B"""
    requires = A
    input = "b"
    plugin_opts = {"diagram_hide": True}


class PG(ProcGroup):
    """Process Group"""
    @ProcGroup.add_proc
    def c(self):
        """Process C"""
        class C(Proc):
            input = "c"

        return C

    @ProcGroup.add_proc
    def c1(self):
        """Process C1"""
        class C1(Proc):
            requires = self.c
            input = "c1"
            plugin_opts = {"diagram_hide": True}

        return C1

    @ProcGroup.add_proc
    def d(self):
        """Process D"""
        class D(Proc):
            input = "d"
            requires = self.c1

        return D


pg = PG()
pg.c.requires = B


class E(Proc):
    """Process E"""
    input = "e1,e2"
    requires = pg.d, A


class F(Proc):
    """Process F"""
    input = "f"
    requires = E


Pipen("MyPipeline").set_start(A).run()
# Dark theme
# Pipen("MyPipeline", plugin_opts={"diagram_theme": "dark"}).set_start(A).run()

Running python example.py will generate MyPipeline-output/diagram.svg:

Default theme Dark theme Fancy theme Fancy dark theme
diagram diagram_dark diagram_fancy diagram_fancy_dark

Metadata

Release files for pipen-diagram 1.1.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pipen-diagram 1.1.2
File Size Uploaded
pipen_diagram-1.1.2.tar.gz 100.0 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for pipen-diagram 1.1.2
File Interpreter ABI Platform
pipen_diagram-1.1.2-py3-none-any.whl Python 3 none any Details

Total release size: 106.3 kB

Release files / pipen_diagram-1.1.2.tar.gz

Download URL pipen_diagram-1.1.2.tar.gz
Size 100.0 kB
Tags Source
SHA-256 checksum
How to use checksums
8770f6cd8dada0e990ef1720c4d598fcc202c8e39467e09cb4193431efcbffed
BLAKE2b-256 checksum
How to use checksums
2faa749aba2712e606c5737141eedcaee83d0d86512c657999c2196d1c800b3d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.12.2 {"installer":{"name":"uv","version":"0.12.2","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / pipen_diagram-1.1.2-py3-none-any.whl

Download URL pipen_diagram-1.1.2-py3-none-any.whl
Size 6.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
5038b98049d211d016a216a53f405937e73f47c44f9dd9b0f6e08d9e1214397e
BLAKE2b-256 checksum
How to use checksums
1377f7bbf114f3bfc1e73c810818521a32b21ff8f942d6aa3d673781f8f7103d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.12.2 {"installer":{"name":"uv","version":"0.12.2","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page