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.- See
pipen_diagram/diagram.pyfor the a theme definition - See https://graphviz.org/ for theme items
- See
diagram_loglevel: The log level of the diagramdiagram_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 |
|---|---|---|---|
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
pipen_diagram-1.0.0.tar.gz
(5.9 kB
view details)
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 pipen_diagram-1.0.0.tar.gz.
File metadata
- Download URL: pipen_diagram-1.0.0.tar.gz
- Upload date:
- Size: 5.9 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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ab0f12cd366f838f14239c5d923b858a23208634f584510aba54c5469971c9c9
|
|
| MD5 |
00fcfe05671ba069f384f22f6e343df5
|
|
| BLAKE2b-256 |
a42d8f96d90e9557a18ab32fddfe702d5682f28aeec65586b93bc7dd95ebb1cf
|
File details
Details for the file pipen_diagram-1.0.0-py3-none-any.whl.
File metadata
- Download URL: pipen_diagram-1.0.0-py3-none-any.whl
- Upload date:
- Size: 6.3 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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d81637239f03f04334301e6a7465f3cfd08d23ffd7791d8d5e4c7e2a46238f1b
|
|
| MD5 |
acc8c7ce3015b1e45b7b777f832e05d2
|
|
| BLAKE2b-256 |
f03333870b17cb81418bc7d4a2ebe970e1acd6e76267d4f5267a524dffae6c96
|