ifgen.generation.python package — docs

Skip to main content
`Ctrl`+`K`

# ifgen.generation.python package

## Module contents

A module implementing code-generation interfaces for Python.

ifgen.generation.python.python_class(writer: IndentedFileWriter, name: str, docstring: str, parents: list[str] = None, final_empty: int = 2) → Iterator[None]

  Write class definition contents.

ifgen.generation.python.python_docstring(writer: IndentedFileWriter, *docstrings: str, empty: bool = True) → None

  Write docstring data.

ifgen.generation.python.python_function(writer: IndentedFileWriter, name: str, docstring: str, params: str = '', return_type: str = 'None', final_empty: int = 2, decorators: Iterable[str] = None) → Iterator[None]

  Write a Python function.

ifgen.generation.python.python_imports(writer: IndentedFileWriter, built_in: dict[str, list[str]] = None, third_party: dict[str, list[str]] = None, internal: dict[str, list[str]] = None, final_empty: int = 2) → None

  Write Python-module imports.

ifgen.generation.python.write_imports(writer: IndentedFileWriter, label: str, imports: dict[str, list[str]]) → None

  Write a group of Python imports to a file.