type_bridge.generator.render.package¶
package
¶
Render package init.py with exports and schema utilities.
render_package_init
¶
render_package_init(attr_class_names, entity_class_names, relation_class_names, *, schema_version='1.0.0', include_schema_loader=True, schema_filename='schema.tql', functions_present=False)
Render the package init.py source.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
attr_class_names
|
dict[str, str]
|
Mapping from TypeDB attr names to Python class names |
required |
entity_class_names
|
dict[str, str]
|
Mapping from TypeDB entity names to Python class names |
required |
relation_class_names
|
dict[str, str]
|
Mapping from TypeDB relation names to Python class names |
required |
schema_version
|
str
|
Version string for SCHEMA_VERSION constant |
'1.0.0'
|
include_schema_loader
|
bool
|
Whether to include schema_text() helper |
True
|
schema_filename
|
str | None
|
Filename for the schema file (used in schema_text() loader) |
'schema.tql'
|
functions_present
|
bool
|
Whether to export functions module |
False
|
Returns:
| Type | Description |
|---|---|
str
|
Complete Python source code for init.py |