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:
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:

TCodeScript

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:

TCodeScript

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].