Generate Python Code
cc_generate_python_codeGenerate Python code snippets from templates for functions, classes, tests, and modules, without creating files.
Instructions
Generiert Python-Code-Snippets aus BACH-abgeleiteten Templates ohne Dateien zu schreiben
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| act | No | Act block for test generation | |
| base | No | Base exception class for exception generation | |
| body | No | Function or method body | |
| kind | No | Template kind | |
| name | No | Generated item name | |
| target | No | Target name for test generation | |
| arrange | No | Arrange block for test generation | |
| content | No | Module content | |
| docstring | No | Docstring | |
| main_body | No | CLI main body | |
| spec_json | No | Optional full JSON spec. If set, it is merged with the explicit fields. | |
| assertions | No | Assert block for test generation | |
| bases_json | No | JSON array of class base names | |
| description | No | Module or CLI description | |
| fields_json | No | JSON array of dataclass fields | |
| params_json | No | JSON array of parameters: [{"name":"x","type":"int","default":"0"}] | |
| return_type | No | Return type annotation for functions | |
| imports_json | No | JSON array of import lines for module generation | |
| init_params_json | No | JSON array of __init__ parameters for classes |