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][source]#

Write class definition contents.

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][source]#

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[source]#

Write Python-module imports.

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

Write a group of Python imports to a file.