THE ORIONIS API
Build with clarity.
Explore the building blocks of an async-first Python framework. Every module, class, and method — connected, searchable, and ready to build with.
Attribute handling behavior shared by every model.
| Class | |
Attribute handling behavior shared by every model. |
| Function | _cast |
Cast a raw value to bool handling common textual forms. |
| Function | _cast |
Cast a raw value to date. |
| Function | _cast |
Cast a raw value to datetime. |
| Function | _cast |
Cast a raw value to a JSON-decoded Python structure. |
| Function | _cast |
Cast a raw value to uuid.UUID. |
| Function | get |
Return the cast handler registered under the given name. |
| Function | serialize |
Convert attribute values into driver-friendly storage values. |
| Constant | _CAST |
Registry of supported cast names. |
| Constant | _TRUTHY |
Strings interpreted as truthy when casting to bool. |
Cast a raw value to bool handling common textual forms.
| Parameters | |
value:typing.Any | Raw attribute value. |
| Returns | |
bool | Boolean representation of the value. |
Cast a raw value to date.
| Parameters | |
value:typing.Any | Date, datetime, or ISO-8601 string. |
| Returns | |
datetime.date | Date representation of the value. |
Cast a raw value to datetime.
| Parameters | |
value:typing.Any | Datetime instance, ISO-8601 string, or POSIX timestamp. |
| Returns | |
datetime.datetime | Datetime representation of the value. |
Cast a raw value to a JSON-decoded Python structure.
| Parameters | |
value:typing.Any | JSON string, or an already decoded structure. |
| Returns | |
typing.Any | Decoded Python structure. |
Cast a raw value to uuid.UUID.
| Parameters | |
value:typing.Any | UUID instance or its string form. |
| Returns | |
uuid.UUID | UUID representation of the value. |
Return the cast handler registered under the given name.
| Parameters | |
cast:str | Cast name declared in a model casts mapping. |
| Returns | |
collections.abc.Callable | Function converting raw values into the cast type. |
| Raises | |
orionis.orm.exceptions.OrmException | If the cast name is not supported. |
metaclass_module.ModelMetadata, values: dict[ str, Any]) -> dict[ str, Any]:
(source)
¶
Convert attribute values into driver-friendly storage values.
Structures stored outside JSON or PickleType columns are serialized to strings, and UUID objects targeting neither UUID nor PickleType columns are stringified; every other value passes through unchanged.
| Parameters | |
meta:orionis.orm.metaclass.ModelMetadata | Metadata of the model owning the attributes. |
values:dict | Attribute values to serialize. |
| Returns | |
dict | Values ready to be bound into an SQL statement. |
Registry of supported cast names.
| Value |
|