ifgen.struct.python package — docs

Skip to main content
`Ctrl`+`K`

# ifgen.struct.python package

## Module contents

A module implementing Python struct-generation interfaces.

ifgen.struct.python.cpp_ns_final(data: str) → str

  Get only the final string in a C++ style namespace string.

ifgen.struct.python.python_dependencies(enums: list[str], structs: list[str], enum_prefix: str = '..enums', struct_prefix: str = '') → dict[str, list[str]]

  Get the names of external (to the module being generated) dependencies by type.

ifgen.struct.python.python_enums_structs(task: GenerateTask) → tuple[list[str], list[str]]

  Get enum and struct dependency information for this task.

ifgen.struct.python.python_struct_field(writer: IndentedFileWriter, types: TypeSystem, field: dict[str, Any], structs: list[str], enums: list[str]) → None

  Write lines for a struct field.

ifgen.struct.python.python_struct_fields(task: GenerateTask, writer: IndentedFileWriter, structs: list[str], enums: list[str]) → None

  Write protocol initialization code.

ifgen.struct.python.python_struct_header(task: GenerateTask, writer: IndentedFileWriter) → None

  Create a Python module for a struct.