bytewax.visualize#

Visualize dataflow structure.

This most easily used via running this module as a script. Run python -m bytewax.visualize --help or see Visualizing Structure for more info.

Classes#

class RenderedPort#

Port with streams resolved to globally-unique IDs.

port_name: str#
port_id: str#
from_port_ids: List[str]#
from_stream_ids: List[str]#
class RenderedOperator#

Operator with all ports resolved to globally-unique IDs.

op_type: str#
step_name: str#
step_id: str#
inp_ports: List[RenderedPort]#
out_ports: List[RenderedPort]#
substeps: List[Self]#
class RenderedDataflow#

Dataflow with streams, ports resolved to globally-unique IDs.

flow_id: str#
substeps: List[RenderedOperator]#

Functions#

to_rendered(
flow: Dataflow,
) RenderedDataflow#

Convert a dataflow into the “rendered” data model.

This resolves all port links for you. All you have to do is set up the links by connecting RenderedPort.port_id to all RenderedPort.from_port_ids.

Parameters:

flow – Dataflow.

Returns:

Rendered dataflow.

to_json(flow: Dataflow) str#

Encode this dataflow into JSON.

Parameters:

flow – Dataflow.

Returns:

JSON string.

to_plantuml(flow: Dataflow, recursive: bool = False) str#

Generate a PlantUML diagram of a dataflow.

This most easily used via running this module as a script. Run python -m bytewax.visualize --help or see Visualizing Structure for more info.

See the PlantUML website for more info on PlantUML.

Parameters:
  • flow – Dataflow.

  • recursive – Wheither to show sub-steps. Defaults to False.

Returns:

PlantUML diagram string.

to_mermaid(flow: Dataflow) str#

Generate a Mermaid diagram of a dataflow.

This most easily used via running this module as a script. Run python -m bytewax.visualize --help or see Visualizing Structure for more info.

See the Mermaid docs for more info on Mermaid.

Does not show any sub-steps.

Parameters:

flow – Dataflow.

Returns:

Mermaid diagram string.

Join our community Slack channel

Need some help? Join our community!

If you have any trouble with the process or have ideas about how to improve this document, come talk to us in the #questions-answered Slack channel!

Join now