Python API reference
Package | Module | Function | InitializerGroupPackage, Module, Function, and InitializerGroup
Typed ownership and generated callback metadata passed to type, endpoint, and stream factories.
When to use
Create these objects once and reuse them instead of passing package, module, and initializer names as strings.
Behavior
Packagerepresents a logical target-language package path.Moduleis registered on Project and represents a generated or shared module owner.Functiondescribes one generated business callback and references Package, Module, and InitializerGroup objects.ROOT_PACKAGEandLOCAL_MODULEexplicitly represent root-package placement and local ownership.
Package(path="") properties
Logical package metadata.
PropertyTypeDescription
pathstrLogical package path; empty means the selected generated root.
Default:emptyROOT_PACKAGEPackageReusable empty Package singleton.
project.module() properties
Registered shared owner.
PropertyTypeDescription
namestrModule name and derived key.
Requiredmodule_pathstrPublished repository/module path.
Requiredgolang_versionstrGo language version metadata.
RequiredFunction() properties
Generated callback contract metadata.
PropertyTypeDescription
namestrGenerated callback/type name.
RequiredpackagePackageFunction package object.
Default:ROOT_PACKAGEdescriptionstrGenerated documentation.
Default:emptyinitializer_groupInitializerGroupDependency-initialization group.
Default:empty InitializerGroupmoduleModule | LOCAL_MODULE | NonePublic owner, explicit local owner, or omitted field.
Default:Nonepublicbool | NoneGenerate the callback through a public ownership path.
Default:NonePython example
domain_package = Package("domain/orders")
startup = InitializerGroup("startup")
model = project.module(
"Model",
module_path="github.com/example/orders/model",
golang_version="1.25.4",
)
validate_order = Function(
name="ValidateOrder",
package=domain_package,
initializer_group=startup,
module=LOCAL_MODULE,
)