project.<primitive>_type(name, ...)Primitive type factories
Create named definitions over built-in DataType contracts without passing a string discriminator.
When to use
Use a named primitive when the graph needs a reusable alias or documented contract; pass DataType directly when no named declaration is needed.
Behavior
- Every method returns and registers TypeDefinition.
use_aliascontrols alias generation for primitive definitions.- Width-specific integer methods preserve signedness and width across generated targets.
Signed and general numeric factories properties
Numeric built-ins.
int_type()intTarget-native signed integer.
int8_type(), int16_type()int8 / int16Fixed-width signed integers.
int32_type(), int64_type()int32 / int64Fixed-width signed integers.
float_type(), double_type()float / doubleFloating-point contracts.
Unsigned factories properties
Unsigned integer built-ins.
uint_type()uintTarget-native unsigned integer.
uint8_type(), uint16_type()uint8 / uint16Fixed-width unsigned integers.
uint32_type(), uint64_type()uint32 / uint64Fixed-width unsigned integers.
Other scalar/runtime factories properties
Text and framework contracts.
byte_type(), char_type(), unicode_char_type()byte / charByte and character representations.
boolean_type()booleanTrue/false contract.
string_type(), unicode_string_type()stringText contracts.
any_type()anyIntentionally dynamic payload.
error_type()errorFramework error contract.
Common keyword options properties
Available on every primitive factory.
namestrHuman-readable name. A stable camelCase key is derived and registered on the Project.
Requireddescriptionstr | NoneDocumentation emitted with the generated type.
Default:Nonepublic_typebool | NoneMake the type reusable through a project Module.
Default:NonemoduleModule | LOCAL_MODULE | NoneOwner of a public type. Use an object, not a module-name string.
Default:NonepackagePackage | NoneTyped package metadata object.
Default:Noneuse_aliasbool | NoneGenerate a target-language alias over the built-in.
Default:NonePython example
order_id = project.string_type(
"Order ID",
use_alias=True,
description="Stable public order identifier.",
public_type=True,
module=model_module,
)