Skip to content

schemas

Provides schemas used in Plugboard.

This includes:

  • Pydantic models for specifying Plugboard objects;
  • TypeDict definitions for constructor **kwargs.

ComponentArgsDict

Bases: TypedDict

TypedDict of the Component constructor arguments.

ComponentArgsSpec

Bases: PlugboardBaseModel

Specification of the Component constructor arguments.

Attributes:

Name Type Description
name str

The name of the Component.

initial_values dict[str, Any]

Initial values for the Component.

parameters dict[str, Any]

Parameters for the Component.

constraints dict[str, Any]

Constraints for the Component.

ComponentSpec

Bases: PlugboardBaseModel

Specification of a Component.

Attributes:

Name Type Description
type str

The type of the Component.

args ComponentArgsSpec

The arguments for the Component.

ConfigSpec

Bases: PlugboardBaseModel

Configuration for a Plugboard simulation.

Attributes:

Name Type Description
plugboard ProcessConfigSpec

A ProcessConfig that specifies the Plugboard Process.

ConnectorBuilderArgsDict

Bases: TypedDict

TypedDict of the Connector constructor arguments.

ConnectorBuilderArgsSpec

Bases: PlugboardBaseModel

Specification of the Connector constructor arguments.

Attributes:

Name Type Description
parameters dict[str, Any]

Parameters for the Connector.

ConnectorBuilderSpec

Bases: PlugboardBaseModel

Specification of a ConnectorBuilder.

Attributes:

Name Type Description
type str

The type of the ConnectorBuilder.

args ConnectorBuilderArgsSpec

Optional; The arguments for the ConnectorBuilder.

ConnectorMode

Bases: StrEnum

Defines the mode of a connector.

Attributes:

Name Type Description
PIPELINE

one-in-one-out task queue.

PUBSUB

one-to-many event distribution.

ConnectorSocket

Bases: PlugboardBaseModel

ConnectorSocket defines a source or target connection point on a Connector.

There are two typical types of connections in use: those between attributes of components; and those connecting components with events which they either emit or consume. When connecting two component attributes together, the entity is the name of the component, and the descriptor is the name of the attribute. When connecting components with events, the entity is the name of the event, and the descriptor is either "publishers" or "subscribers" as appropriate.

Attributes:

Name Type Description
entity str

The name of the entity.

descriptor str

The name of the descriptor on the entity.

id property

id: str

Unique ID for ConnectorSocket.

connects_to

connects_to(entities: Container[str]) -> bool

Returns True if the ConnectorSocket connects to any of the named entities.

from_ref classmethod

from_ref(ref: str) -> _t.Self

Creates a ConnectorSocket from a reference string.

ConnectorSpec

Bases: PlugboardBaseModel

ConnectorSpec defines a connection between two entities.

Attributes:

Name Type Description
source ConnectorSocket

The source endpoint.

target ConnectorSocket

The target endpoint.

mode ConnectorMode

The mode of the connector.

id property

id: str

Unique ID for ConnectorSpec.

Entity

Bases: StrEnum

Entity names.

id_prefix property

id_prefix: str

Returns prefix for generating unique entity ids.

id_regex property

id_regex: str

Returns regex for validating entity ids.

IODirection

Bases: StrEnum

IODirection defines the type of IO operation.

Attributes:

Name Type Description
INPUT

Specifies an input to a Component.

OUTPUT

Specifies an output to a Component.

ProcessArgsDict

Bases: TypedDict

TypedDict of the Process constructor arguments.

ProcessArgsSpec

Bases: PlugboardBaseModel

Specification of the Process constructor arguments.

Attributes:

Name Type Description
components Annotated[list[ComponentSpec], Len(min_length=1)]

Specifies each Component in the Process.

connectors list[ConnectorSpec]

Specifies the connections between each Component.

name Optional[str]

Unique identifier for Process.

parameters dict[str, Any]

Parameters for the Process.

state StateBackendSpec

Optional; Specifies the StateBackend used for the Process.

ProcessConfigSpec

Bases: PlugboardBaseModel

A ProcessSpec within a Plugboard configuration.

Attributes:

Name Type Description
process ProcessSpec

A ProcessSpec that specifies the process.

ProcessSpec

Bases: PlugboardBaseModel

Specification of a Plugboard Process.

Attributes:

Name Type Description
args ProcessArgsSpec

The arguments for the Process.

type Literal['plugboard.process.LocalProcess', 'plugboard.process.RayProcess']

The type of Process to build.

connector_builder ConnectorBuilderSpec

The ConnectorBuilder to use for the Process.

StateBackendArgsDict

Bases: TypedDict

TypedDict of the StateBackend constructor arguments.

StateBackendArgsSpec

Bases: PlugboardBaseModel

Specification of the StateBackend constructor arguments.

Attributes:

Name Type Description
job_id Optional[str]

The unique id for the job.

metadata dict[str, Any]

Metadata for a run.

StateBackendSpec

Bases: PlugboardBaseModel

Specification of a Plugboard StateBackend.

Attributes:

Name Type Description
type str

The type of the StateBackend.

args StateBackendArgsSpec

The arguments for the StateBackend.