Skip to main content

Draw pipeline diagrams for pipen.

Project description

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

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

pipen_diagram-1.1.1.tar.gz (6.1 kB view details)

Uploaded Source

Built Distribution

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

pipen_diagram-1.1.1-py3-none-any.whl (6.4 kB view details)

Uploaded Python 3

File details

Details for the file pipen_diagram-1.1.1.tar.gz.

File metadata

  • Download URL: pipen_diagram-1.1.1.tar.gz
  • Upload date:
  • Size: 6.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.2.1 CPython/3.12.3 Linux/6.11.0-1018-azure

File hashes

Hashes for pipen_diagram-1.1.1.tar.gz
Algorithm Hash digest
SHA256 5e5dab4574990ed87cd9d3e4f9f2851ace7289228688a4a83d38968016b39804
MD5 83f128ff5e777618a66bff2bfac5c874
BLAKE2b-256 0ad4f936e1c4aa7333e6e1538b33d8d163d55781b636d5ac1c547c7b25b73487

See more details on using hashes here.

File details

Details for the file pipen_diagram-1.1.1-py3-none-any.whl.

File metadata

  • Download URL: pipen_diagram-1.1.1-py3-none-any.whl
  • Upload date:
  • Size: 6.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.2.1 CPython/3.12.3 Linux/6.11.0-1018-azure

File hashes

Hashes for pipen_diagram-1.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 e6b2f9d4b2cd600ed1ed506f9d21ddbe245a46a4080bfc5a9f5c3a4e18b849d2
MD5 570e46cd9ae5bf64e6f1061e4ff28f75
BLAKE2b-256 f6c953704bd8d0e388149d6e3137b9f882bc97670778a5aba510a210b0b61b34

See more details on using hashes here.

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