Script¶
The top-level T-code script and metadata structures. A TCodeScript
is a container for a list of T-code commands along with its Metadata.
Documentation¶
TCode script schemas: top-level script and metadata.
- class tcode_api.schemas.script.Metadata(**data)¶
TCode script metadata.
- Parameters:
schema_version (Literal[1])
type (Literal['Metadata'])
name (str)
timestamp (str)
tcode_api_version (str)
description (str | None)
- model_config: ClassVar[ConfigDict] = {'extra': 'ignore', 'strict': True}¶
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class tcode_api.schemas.script.TCodeScript(**data)¶
Structure of a TCode script.
- Parameters:
schema_version (Literal[1])
type (Literal['TCodeScript'])
metadata (Metadata)
commands (list[Annotated[ASPIRATE | ADD_LABWARE | ADD_PIPETTE_TIP_GROUP | ADD_ROBOT | ADD_TOOL | CALIBRATE_LABWARE_WELL_DEPTH | CALIBRATE_LABWARE_HEIGHT | CALIBRATE_LABWARE_HOLDER | CALIBRATE_TOOL | COMMENT | CREATE_LABWARE | DELETE_LABWARE | DISCARD_PIPETTE_TIP_GROUP | DISPENSE | MOVE_GRIPPER | MOVE_TO_LOCATION | MOVE_TO_JOINT_POSE | PAUSE | PICK_UP_LABWARE | PICK_UP_PIPETTE_TIP | PUT_DOWN_LABWARE | PUT_DOWN_PIPETTE_TIP | REMOVE_LABWARE_LID | REPLACE_LABWARE_LID | RETRIEVE_PIPETTE_TIP_GROUP | RETRIEVE_TOOL | RETURN_PIPETTE_TIP_GROUP | RETURN_TOOL | SWAP_TO_TOOL | SEND_WEBHOOK | WAIT, FieldInfo(annotation=NoneType, required=True, description='Union type of all valid TCode commands.', discriminator='type')]])
- classmethod new(name, description=None)¶
Create a new, empty TCode script with the given name and optional description.
- Parameters:
name (
str) – Name of the TCode script.description (
str|None) – Optional description of the TCode script.
- Return type:
- Returns:
A new, empty TCode script.
- classmethod read(file_object)¶
Load a TCode script from a file-like object.
- Parameters:
file_object (
TextIO) – A file-like object containing the TCode script.- Return type:
- Returns:
The loaded TCode script.
- model_config: ClassVar[ConfigDict] = {'extra': 'ignore', 'strict': True}¶
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].