Package | Module | Function | InitializerGroupPackage, Module, Function, and InitializerGroup — Python Architecture DSL
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.
pathstrFor Function, a relative path below the generated functions root; empty uses that root. On TypeDefinition, Package is alias/compatibility metadata, not a type-directory override. See Packages and Modules for each language.
Default:emptyROOT_PACKAGEPackageReusable empty Package singleton.
project.module() properties
Registered shared owner.
namestrModule name, used as its exact registry key.
Requiredmodule_pathstrPublished repository/module path.
Requiredgolang_versionstrGo language version metadata.
RequiredFunction() properties
Generated callback contract metadata.
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,
)