Skip to content

Argument types

uptimely.spec.arg_types defines argument types used in Spec documents. Collections can be described with array_of() and object_values_of().

Argument type names and helpers for spec function arguments.

AtomicArgumentType module-attribute

AtomicArgumentType = typing.Literal['dataframe', 'string', 'integer', 'float', 'boolean', 'array', 'object']

ATOMIC_ARGUMENT_TYPES module-attribute

ATOMIC_ARGUMENT_TYPES: Final[tuple[AtomicArgumentType, ...]] = typing.get_args(AtomicArgumentType)

DATAFRAME module-attribute

DATAFRAME: Final[str] = 'dataframe'

STRING module-attribute

STRING: Final[str] = 'string'

INTEGER module-attribute

INTEGER: Final[str] = 'integer'

FLOAT module-attribute

FLOAT: Final[str] = 'float'

BOOLEAN module-attribute

BOOLEAN: Final[str] = 'boolean'

ARRAY module-attribute

ARRAY: Final[str] = 'array'

OBJECT module-attribute

OBJECT: Final[str] = 'object'

array_of

array_of(item_type: str) -> str

Return the spec expression for an array with homogeneous item types.

object_values_of

object_values_of(value_type: str) -> str

Return the spec expression for a string-keyed object with homogeneous values.

array_item_type

array_item_type(type_expression: str) -> str | None

Return the item type from an array expression, if it is homogeneous.

object_value_type

object_value_type(type_expression: str) -> str | None

Return the value type from a homogeneous string-keyed object expression.