bundle.core.entity

Attributes

Classes

Identifier

Base data model class, providing utilities for serialization and deserialization

Entity

An extension of the Data model that represents an entity with enhanced introspection

Module Contents

bundle.core.entity.LOGGER
bundle.core.entity.NAMESPACE
bundle.core.entity.UNIQUE_GENERATOR_ACTIVE = True
class bundle.core.entity.Identifier(/, **data: Any)[source]

Bases: bundle.core.data.Data

Base data model class, providing utilities for serialization and deserialization from/to JSON, along with JSON Schema generation.

model_config

Default model configuration settings.

index: int
uuid: str
static next() Identifier[source]
bundle.core.entity.ENTITY_ID_GENERATOR
class bundle.core.entity.Entity(/, **data: Any)[source]

Bases: bundle.core.Data

An extension of the Data model that represents an entity with enhanced introspection and optional persistence capabilities. It tracks the entity’s creation time and can automatically save its state upon destruction if configured to do so.

name

The name of the entity, with a default value of “Default”.

Type:

str

born_time

The timestamp of entity instantiation, in nanoseconds.

Type:

int

Properties:

class_name (str): The name of the entity’s class. age (int): The age of the entity in nanoseconds, calculated from its born_time.

version: str
name: str = None
identifier: Identifier = None
born_time: int = None
property class_name: str

Returns the class name of the instance.

property age: int

Calculates and returns the age of the entity in nanoseconds since instantiation.