Python API reference
service.component(name, *, description=None)Component
A service-owned definition of repeated graph fragments. Register each concrete repetition using existing Stream objects.
When to use
Declare the graph normally, then annotate identical connected fragments for the Designer.
Behavior
service.component(name, description=...)registers and returns a Component with an identity derived from its name. Do not supply UUIDs or a separate key.component.fragment(*streams, appearance=None)registers one concrete repetition. Pass the actual Stream objects after creating their connections. The method does not connect streams or copy their functions.- Pipelines remain independent: create them through
service.pipeline(name). There is nocomponent.pipeline(...)or pipelinecomponent=ownership parameter. - Put optional collapsed-card coordinates on each
fragment(...)throughAppearance(x=..., y=...), not on the component definition. Either coordinate may be omitted; fragment color is not supported. - YAML-to-Python generation emits a named Component and its fragment registrations. Serialized membership references existing pipeline/stream keys rather than runtime numeric IDs or occurrence identifiers.
- Python membership checks reject foreign or unregistered streams and overlapping fragments. Use the Designer's semantic matching/rebuild to inspect whether repeated fragments still have equivalent functions, types and connections.
Component definition properties
Shared visual identity, not a runtime wrapper.
PropertyTypeDescription
namestrNon-empty display name. The component key is derived from this name.
Requireddescriptionstr | NoneOptional description of the repeated business logic.
Default:Nonefragment(*streams, appearance=None) properties
One concrete repetition of the definition.
PropertyTypeDescription
streamsStream...Existing stream objects from this service. Membership does not create graph connections.
RequiredappearanceAppearance | NoneOptional position of this repetition when collapsed; x and y are optional.
Default:NoneAnnotate repeated business logic
# Declare each pipeline and its concrete streams normally.
# Connect the streams before registering their repeated fragments.
load_create >> price_create
load_update >> price_update
pricing = service.component(
"Customer Pricing",
description="Load customer data and calculate the effective price.",
)
pricing.fragment(load_create, price_create)
pricing.fragment(
load_update, price_update,
appearance=Appearance(x=400, y=200),
)
# load_create/load_update use the same function identity.
# price_create/price_update use the same function identity.
# The four streams remain separate runtime nodes.