bundle.core.entity ================== .. py:module:: bundle.core.entity Attributes ---------- .. autoapisummary:: bundle.core.entity.LOGGER bundle.core.entity.NAMESPACE bundle.core.entity.UNIQUE_GENERATOR_ACTIVE bundle.core.entity.ENTITY_ID_GENERATOR Classes ------- .. autoapisummary:: bundle.core.entity.Identifier bundle.core.entity.Entity Module Contents --------------- .. py:data:: LOGGER .. py:data:: NAMESPACE .. py:data:: UNIQUE_GENERATOR_ACTIVE :value: True .. py:class:: Identifier(/, **data: Any) Bases: :py:obj:`bundle.core.data.Data` Base data model class, providing utilities for serialization and deserialization from/to JSON, along with JSON Schema generation. .. attribute:: model_config Default model configuration settings. .. py:attribute:: index :type: int .. py:attribute:: uuid :type: str .. py:method:: next() -> Identifier :staticmethod: .. py:data:: ENTITY_ID_GENERATOR .. py:class:: Entity(/, **data: Any) Bases: :py:obj:`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. .. attribute:: name The name of the entity, with a default value of "Default". :type: str .. attribute:: 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`. .. py:attribute:: version :type: str .. py:attribute:: name :type: str :value: None .. py:attribute:: identifier :type: Identifier :value: None .. py:attribute:: born_time :type: int :value: None .. py:property:: class_name :type: str Returns the class name of the instance. .. py:property:: age :type: int Calculates and returns the age of the entity in nanoseconds since instantiation.