Internal Models
Internal models for basic services are used to communicate between different components of the basic service and its components.
Data Handling Models
These models are used for handling data within the basic service or its components.
- pydantic model encodapy.utils.models.ComponentModel[source]
Model for the dataflow (input/output) of the controller.
- Variables:
entity – The entity (input / output) of the datapoint for the controller
attribute – The attribute of the datapoint for the controller
Show JSON schema
{ "title": "ComponentModel", "description": "Model for the dataflow (input/output) of the controller.\n\nAttributes:\n entity: The entity (input / output) of the datapoint for the controller\n attribute: The attribute of the datapoint for the controller", "type": "object", "properties": { "entity_id": { "title": "Entity Id", "type": "string" }, "attribute_id": { "title": "Attribute Id", "type": "string" } }, "required": [ "entity_id", "attribute_id" ] }
- pydantic model encodapy.utils.models.DataTransferComponentModel[source]
Model for the components of the data transfer between calculation and the basic service.
- Variables:
entity_id – The id of the entity of the component
attribute_id – The id of the attribute of the component
value – The output data value as OutputDataModel
unit – The unit of the output data
timestamp – The timestamp of the output
Show JSON schema
{ "title": "DataTransferComponentModel", "description": "Model for the components of the data transfer between calculation and the basic service.\n\nAttributes:\n entity_id: The id of the entity of the component\n attribute_id: The id of the attribute of the component\n value: The output data value as OutputDataModel\n unit: The unit of the output data\n timestamp: The timestamp of the output", "type": "object", "properties": { "entity_id": { "title": "Entity Id", "type": "string" }, "attribute_id": { "title": "Attribute Id", "type": "string" }, "value": { "anyOf": [ { "type": "string" }, { "type": "number" }, { "type": "integer" }, { "type": "boolean" }, { "type": "object" }, { "items": {}, "type": "array" }, { "type": "null" } ], "title": "Value" }, "unit": { "anyOf": [ { "$ref": "#/$defs/DataUnits" }, { "type": "null" } ], "default": null }, "timestamp": { "anyOf": [ { "format": "date-time", "type": "string" }, { "type": "null" } ], "default": null, "title": "Timestamp" } }, "$defs": { "DataUnits": { "description": "Possible units for the data\nUnits which are defined by Unit Code (https://unece.org/trade/cefact/UNLOCODE-Download\nor https://github.com/RWTH-EBC/FiLiP/blob/master/filip/data/unece-units/units_of_measure.csv)\nor here: https://unece.org/fileadmin/DAM/cefact/recommendations/rec20/rec20_rev3_Annex3e.pdf\nTODO:\n - Is there a better way to handle the units?\n - Add more units?", "enum": [ "SEC", "HUR", "MIN", "CEL", "KEL", "LTR", "MTQ", "MQH", "MQS", "E32", "L2", "WTT", "WHR", "KWH", "CMT", "MTR", "MTK", "MTS", "P1", "OHM", "VLT" ], "title": "DataUnits", "type": "string" } }, "required": [ "entity_id", "attribute_id", "value" ] }
- pydantic model encodapy.utils.models.DataTransferModel[source]
Model for the data transfer between calculation and the basic service.
- Variables:
components – List of the components of the data transfer as DataTransferComponentModel
Show JSON schema
{ "title": "DataTransferModel", "description": "Model for the data transfer between calculation and the basic service.\n\nAttributes:\n components: List of the components of the data transfer as DataTransferComponentModel", "type": "object", "properties": { "components": { "default": [], "items": { "$ref": "#/$defs/DataTransferComponentModel" }, "title": "Components", "type": "array" } }, "$defs": { "DataTransferComponentModel": { "description": "Model for the components of the data transfer between calculation and the basic service.\n\nAttributes:\n entity_id: The id of the entity of the component\n attribute_id: The id of the attribute of the component\n value: The output data value as OutputDataModel\n unit: The unit of the output data\n timestamp: The timestamp of the output", "properties": { "entity_id": { "title": "Entity Id", "type": "string" }, "attribute_id": { "title": "Attribute Id", "type": "string" }, "value": { "anyOf": [ { "type": "string" }, { "type": "number" }, { "type": "integer" }, { "type": "boolean" }, { "type": "object" }, { "items": {}, "type": "array" }, { "type": "null" } ], "title": "Value" }, "unit": { "anyOf": [ { "$ref": "#/$defs/DataUnits" }, { "type": "null" } ], "default": null }, "timestamp": { "anyOf": [ { "format": "date-time", "type": "string" }, { "type": "null" } ], "default": null, "title": "Timestamp" } }, "required": [ "entity_id", "attribute_id", "value" ], "title": "DataTransferComponentModel", "type": "object" }, "DataUnits": { "description": "Possible units for the data\nUnits which are defined by Unit Code (https://unece.org/trade/cefact/UNLOCODE-Download\nor https://github.com/RWTH-EBC/FiLiP/blob/master/filip/data/unece-units/units_of_measure.csv)\nor here: https://unece.org/fileadmin/DAM/cefact/recommendations/rec20/rec20_rev3_Annex3e.pdf\nTODO:\n - Is there a better way to handle the units?\n - Add more units?", "enum": [ "SEC", "HUR", "MIN", "CEL", "KEL", "LTR", "MTQ", "MQH", "MQS", "E32", "L2", "WTT", "WHR", "KWH", "CMT", "MTR", "MTK", "MTS", "P1", "OHM", "VLT" ], "title": "DataUnits", "type": "string" } } }
-
field components:
list[DataTransferComponentModel] = []
- pydantic model encodapy.utils.models.InputDataAttributeModel[source]
Model for a attribute of input data of the system controller.
- Variables:
id (
str) – The id of the input data attributedata (
Union[str,float,int,bool,Dict,List,DataFrame,None]) – The input data as a DataFrame or a single valueunit (
Union[DataUnits,None]) – The unit of the input datadata_type (
AttributeTypes) – The type of the input data (AttributeTypes)data_available (
bool) – If the data is availablelatest_timestamp_input (
Union[datetime,None]) – The latest timestamp of the input data from the query or None, if the data is not available
Show JSON schema
{ "title": "InputDataAttributeModel", "description": "Model for a attribute of input data of the system controller.\n\nAttributes:\n id (str): The id of the input data attribute\n data (Union[str, float, int, bool, Dict, List, DataFrame, None]): The input data as a DataFrame or a single value\n unit (Union[DataUnits, None]): The unit of the input data\n data_type (AttributeTypes): The type of the input data (AttributeTypes)\n data_available (bool): If the data is available\n latest_timestamp_input (Union[datetime, None]): The latest timestamp of the input data from the query or None, if the data is not available", "type": "object", "properties": { "id": { "title": "Id", "type": "string" }, "data": { "anyOf": [ { "type": "string" }, { "type": "number" }, { "type": "integer" }, { "type": "boolean" }, { "type": "object" }, { "items": {}, "type": "array" }, { "type": "null" } ], "title": "Data" }, "unit": { "anyOf": [ { "$ref": "#/$defs/DataUnits" }, { "type": "null" } ], "default": null }, "data_type": { "$ref": "#/$defs/AttributeTypes" }, "data_available": { "title": "Data Available", "type": "boolean" }, "latest_timestamp_input": { "anyOf": [ { "format": "date-time", "type": "string" }, { "type": "null" } ], "title": "Latest Timestamp Input" } }, "$defs": { "AttributeTypes": { "description": "Enum class for the attribute types\n\nAttributes:\n TIMESERIES (str): Timeseries data \"timeseries\"\n VALUE (str): Single value data \"value\"", "enum": [ "timeseries", "value" ], "title": "AttributeTypes", "type": "string" }, "DataUnits": { "description": "Possible units for the data\nUnits which are defined by Unit Code (https://unece.org/trade/cefact/UNLOCODE-Download\nor https://github.com/RWTH-EBC/FiLiP/blob/master/filip/data/unece-units/units_of_measure.csv)\nor here: https://unece.org/fileadmin/DAM/cefact/recommendations/rec20/rec20_rev3_Annex3e.pdf\nTODO:\n - Is there a better way to handle the units?\n - Add more units?", "enum": [ "SEC", "HUR", "MIN", "CEL", "KEL", "LTR", "MTQ", "MQH", "MQS", "E32", "L2", "WTT", "WHR", "KWH", "CMT", "MTR", "MTK", "MTS", "P1", "OHM", "VLT" ], "title": "DataUnits", "type": "string" } }, "required": [ "id", "data", "data_type", "data_available", "latest_timestamp_input" ] }
-
field data_type:
AttributeTypes[Required]
- pydantic model encodapy.utils.models.InputDataEntityModel[source]
Model for the input data of the system controller.
- Variables:
id – The id of the input data entity
attributes – List of the input data attributes as InputDataAttributeModel
Show JSON schema
{ "title": "InputDataEntityModel", "description": "Model for the input data of the system controller.\n\nAttributes:\n id: The id of the input data entity\n attributes: List of the input data attributes as InputDataAttributeModel", "type": "object", "properties": { "id": { "title": "Id", "type": "string" }, "attributes": { "items": { "$ref": "#/$defs/InputDataAttributeModel" }, "title": "Attributes", "type": "array" } }, "$defs": { "AttributeTypes": { "description": "Enum class for the attribute types\n\nAttributes:\n TIMESERIES (str): Timeseries data \"timeseries\"\n VALUE (str): Single value data \"value\"", "enum": [ "timeseries", "value" ], "title": "AttributeTypes", "type": "string" }, "DataUnits": { "description": "Possible units for the data\nUnits which are defined by Unit Code (https://unece.org/trade/cefact/UNLOCODE-Download\nor https://github.com/RWTH-EBC/FiLiP/blob/master/filip/data/unece-units/units_of_measure.csv)\nor here: https://unece.org/fileadmin/DAM/cefact/recommendations/rec20/rec20_rev3_Annex3e.pdf\nTODO:\n - Is there a better way to handle the units?\n - Add more units?", "enum": [ "SEC", "HUR", "MIN", "CEL", "KEL", "LTR", "MTQ", "MQH", "MQS", "E32", "L2", "WTT", "WHR", "KWH", "CMT", "MTR", "MTK", "MTS", "P1", "OHM", "VLT" ], "title": "DataUnits", "type": "string" }, "InputDataAttributeModel": { "description": "Model for a attribute of input data of the system controller.\n\nAttributes:\n id (str): The id of the input data attribute\n data (Union[str, float, int, bool, Dict, List, DataFrame, None]): The input data as a DataFrame or a single value\n unit (Union[DataUnits, None]): The unit of the input data\n data_type (AttributeTypes): The type of the input data (AttributeTypes)\n data_available (bool): If the data is available\n latest_timestamp_input (Union[datetime, None]): The latest timestamp of the input data from the query or None, if the data is not available", "properties": { "id": { "title": "Id", "type": "string" }, "data": { "anyOf": [ { "type": "string" }, { "type": "number" }, { "type": "integer" }, { "type": "boolean" }, { "type": "object" }, { "items": {}, "type": "array" }, { "type": "null" } ], "title": "Data" }, "unit": { "anyOf": [ { "$ref": "#/$defs/DataUnits" }, { "type": "null" } ], "default": null }, "data_type": { "$ref": "#/$defs/AttributeTypes" }, "data_available": { "title": "Data Available", "type": "boolean" }, "latest_timestamp_input": { "anyOf": [ { "format": "date-time", "type": "string" }, { "type": "null" } ], "title": "Latest Timestamp Input" } }, "required": [ "id", "data", "data_type", "data_available", "latest_timestamp_input" ], "title": "InputDataAttributeModel", "type": "object" } }, "required": [ "id", "attributes" ] }
-
field attributes:
List[InputDataAttributeModel] [Required]
- pydantic model encodapy.utils.models.InputDataModel[source]
Model for the input data of the system controller.
- Variables:
input_entities – List of the input data entities as InputDataEntityModel
output_entities – List of the output data entities as OutputDataEntityModel
static_entities – List of the static data entities as StaticDataEntityModel
Show JSON schema
{ "title": "InputDataModel", "description": "Model for the input data of the system controller.\n\nAttributes:\n input_entities: List of the input data entities as InputDataEntityModel\n output_entities: List of the output data entities as OutputDataEntityModel\n static_entities: List of the static data entities as StaticDataEntityModel", "type": "object", "properties": { "input_entities": { "items": { "$ref": "#/$defs/InputDataEntityModel" }, "title": "Input Entities", "type": "array" }, "output_entities": { "items": { "$ref": "#/$defs/OutputDataEntityModel" }, "title": "Output Entities", "type": "array" }, "static_entities": { "items": { "$ref": "#/$defs/StaticDataEntityModel" }, "title": "Static Entities", "type": "array" } }, "$defs": { "AttributeModel": { "description": "Configuration class for representing attributes with metadata, value, and optional interface-specific identifier.\n\nThis class models attributes with a unique ID, type, value, unit, and timestamp.\nIf `id_interface` is not set, it defaults to the value of `id`.\n\nAttributes:\n id (str): The unique identifier of the attribute.\n id_interface (str): The interface-specific identifier. Defaults to `None`.\n If not set, it will be automatically set to the value of `id`.\n type (AttributeTypes): The type of the attribute. Defaults to `AttributeTypes.VALUE`.\n value (Union[str, float, int, bool, Dict, List, pd.DataFrame, None]): The value of the attribute. Defaults to `None`.\n unit (Optional[DataUnits]): The unit of measurement for the value. Defaults to `None`.\n datatype (DataType): The data type of the attribute. Defaults to `DataType(\"Number\")`.\n timestamp (Optional[datetime]): The timestamp of the attribute. Defaults to `None`.\n mqtt_format (Union[MQTTFormatTypes, MQTTTemplateConfig]): The format of the attribute for MQTT (if not set, the default format is used) - only for mqtt interface needed", "properties": { "id": { "title": "Id", "type": "string" }, "id_interface": { "default": "", "title": "Id Interface", "type": "string" }, "type": { "allOf": [ { "$ref": "#/$defs/AttributeTypes" } ], "default": "value" }, "value": { "anyOf": [ { "type": "string" }, { "type": "number" }, { "type": "integer" }, { "type": "boolean" }, { "type": "object" }, { "items": {}, "type": "array" }, { "type": "null" } ], "default": null, "title": "Value" }, "unit": { "anyOf": [ { "$ref": "#/$defs/DataUnits" }, { "type": "null" } ], "default": null }, "datatype": { "allOf": [ { "$ref": "#/$defs/DataType" } ], "default": "Number" }, "timestamp": { "anyOf": [ { "format": "date-time", "type": "string" }, { "type": "null" } ], "default": null, "title": "Timestamp" }, "mqtt_format": { "anyOf": [ { "$ref": "#/$defs/MQTTFormatTypes" }, { "$ref": "#/$defs/MQTTTemplateConfigDoc" } ], "default": "plain", "title": "Mqtt Format" } }, "required": [ "id" ], "title": "AttributeModel", "type": "object" }, "AttributeTypes": { "description": "Enum class for the attribute types\n\nAttributes:\n TIMESERIES (str): Timeseries data \"timeseries\"\n VALUE (str): Single value data \"value\"", "enum": [ "timeseries", "value" ], "title": "AttributeTypes", "type": "string" }, "CommandModel": { "description": "Configuration class for the commands\n\nAttributes:\n id (str): The id of the command\n id_interface (str | None): The id of the command on the interface (if not set, the id is used)\n value (Union[str, int, float, List, Dict, None]): The value of the command", "properties": { "id": { "title": "Id", "type": "string" }, "id_interface": { "default": "", "title": "Id Interface", "type": "string" }, "value": { "anyOf": [ { "type": "string" }, { "type": "integer" }, { "type": "number" }, { "items": {}, "type": "array" }, { "type": "object" }, { "type": "null" } ], "default": null, "title": "Value" } }, "required": [ "id" ], "title": "CommandModel", "type": "object" }, "DataType": { "description": "When possible reuse schema.org data types\n(Text, Number, DateTime, StructuredValue, etc.).\nRemember that null is not allowed in NGSI-LD and\ntherefore should be avoided as a value.\n\nhttps://schema.org/DataType", "enum": [ "Boolean", "Date", "DateTime", "Number", "Integer", "Float", "Text", "Time", "Relationship", "StructuredValue", "Array", "Object", "command", "commandResult", "commandStatus", "geo:json" ], "title": "DataType", "type": "string" }, "DataUnits": { "description": "Possible units for the data\nUnits which are defined by Unit Code (https://unece.org/trade/cefact/UNLOCODE-Download\nor https://github.com/RWTH-EBC/FiLiP/blob/master/filip/data/unece-units/units_of_measure.csv)\nor here: https://unece.org/fileadmin/DAM/cefact/recommendations/rec20/rec20_rev3_Annex3e.pdf\nTODO:\n - Is there a better way to handle the units?\n - Add more units?", "enum": [ "SEC", "HUR", "MIN", "CEL", "KEL", "LTR", "MTQ", "MQH", "MQS", "E32", "L2", "WTT", "WHR", "KWH", "CMT", "MTR", "MTK", "MTS", "P1", "OHM", "VLT" ], "title": "DataUnits", "type": "string" }, "InputDataAttributeModel": { "description": "Model for a attribute of input data of the system controller.\n\nAttributes:\n id (str): The id of the input data attribute\n data (Union[str, float, int, bool, Dict, List, DataFrame, None]): The input data as a DataFrame or a single value\n unit (Union[DataUnits, None]): The unit of the input data\n data_type (AttributeTypes): The type of the input data (AttributeTypes)\n data_available (bool): If the data is available\n latest_timestamp_input (Union[datetime, None]): The latest timestamp of the input data from the query or None, if the data is not available", "properties": { "id": { "title": "Id", "type": "string" }, "data": { "anyOf": [ { "type": "string" }, { "type": "number" }, { "type": "integer" }, { "type": "boolean" }, { "type": "object" }, { "items": {}, "type": "array" }, { "type": "null" } ], "title": "Data" }, "unit": { "anyOf": [ { "$ref": "#/$defs/DataUnits" }, { "type": "null" } ], "default": null }, "data_type": { "$ref": "#/$defs/AttributeTypes" }, "data_available": { "title": "Data Available", "type": "boolean" }, "latest_timestamp_input": { "anyOf": [ { "format": "date-time", "type": "string" }, { "type": "null" } ], "title": "Latest Timestamp Input" } }, "required": [ "id", "data", "data_type", "data_available", "latest_timestamp_input" ], "title": "InputDataAttributeModel", "type": "object" }, "InputDataEntityModel": { "description": "Model for the input data of the system controller.\n\nAttributes:\n id: The id of the input data entity\n attributes: List of the input data attributes as InputDataAttributeModel", "properties": { "id": { "title": "Id", "type": "string" }, "attributes": { "items": { "$ref": "#/$defs/InputDataAttributeModel" }, "title": "Attributes", "type": "array" } }, "required": [ "id", "attributes" ], "title": "InputDataEntityModel", "type": "object" }, "MQTTFormatTypes": { "description": "Enum class for MQTT format types\nPossible values:\n- PLAIN (plain): Plain format\n- FIWARE_ATTR (fiware-attr): FIWARE attribute format\n- FIWARE_CMDEXE (fiware-cmdexe): FIWARE command execution format\n- TEMPLATE (template): Template-based format", "enum": [ "plain", "fiware-attr", "fiware-cmdexe", "template" ], "title": "MQTTFormatTypes", "type": "string" }, "MQTTTemplateConfigDoc": { "description": "Model for MQTT template configuration.\n\n**Mock class for documentation purposes.**\n\nNote:\n In the actual implementation, `topic` and `payload` are `jinja2.Template` objects,\n `time_format` is a `str` as time format for the timestamp in the payload.\n This mock uses `dict` to avoid import issues during documentation generation.\n \n For more information, see :class:`~encodapy.config.mqtt_messages_template.MQTTTemplateConfig`.", "properties": { "topic": { "title": "Topic", "type": "object" }, "payload": { "title": "Payload", "type": "object" }, "time_format": { "default": "%Y-%m-%dT%H:%M:%S%z", "title": "Time Format", "type": "string" } }, "required": [ "topic", "payload" ], "title": "MQTTTemplateConfigDoc", "type": "object" }, "OutputDataAttributeModel": { "description": "Model for a attribute of output data of the system controller - status based on the status of the interface.\n\nAttributes:\n id: The id of the output data attribute\n latest_timestamp_output: The latest timestamp of the output data from the query or None, if the data is not available", "properties": { "id": { "title": "Id", "type": "string" }, "latest_timestamp_output": { "anyOf": [ { "format": "date-time", "type": "string" }, { "type": "null" } ], "default": null, "title": "Latest Timestamp Output" } }, "required": [ "id" ], "title": "OutputDataAttributeModel", "type": "object" }, "OutputDataEntityModel": { "description": "Model for the status of the output data of the system controller.\n\nAttributes:\n id: The id of the output entity\n latest_timestamp_output: The latest timestamp of the output data from the query or None, if the data is not available\n attributes: List of the output data attributes as OutputDataAttributeModel\n commands: List of the output data commands as OutputDataCommandModel", "properties": { "id": { "title": "Id", "type": "string" }, "attributes": { "anyOf": [ { "items": { "$ref": "#/$defs/AttributeModel" }, "type": "array" }, { "type": "null" } ], "default": [], "title": "Attributes" }, "attributes_status": { "anyOf": [ { "items": { "$ref": "#/$defs/OutputDataAttributeModel" }, "type": "array" }, { "type": "null" } ], "default": [], "title": "Attributes Status" }, "commands": { "anyOf": [ { "items": { "$ref": "#/$defs/CommandModel" }, "type": "array" }, { "type": "null" } ], "default": [], "title": "Commands" } }, "required": [ "id" ], "title": "OutputDataEntityModel", "type": "object" }, "StaticDataEntityModel": { "description": "Model for the static data of the system controller, same like InputDataEntityModel.\n\nAttributes:\n id: The id of the input data entity\n attributes: List of the input data attributes as InputDataAttributeModel", "properties": { "id": { "title": "Id", "type": "string" }, "attributes": { "items": { "$ref": "#/$defs/InputDataAttributeModel" }, "title": "Attributes", "type": "array" } }, "required": [ "id", "attributes" ], "title": "StaticDataEntityModel", "type": "object" } }, "required": [ "input_entities", "output_entities", "static_entities" ] }
-
field input_entities:
list[InputDataEntityModel] [Required]
-
field output_entities:
list[OutputDataEntityModel] [Required]
-
field static_entities:
list[StaticDataEntityModel] [Required]
- pydantic model encodapy.utils.models.OutputDataAttributeModel[source]
Model for a attribute of output data of the system controller - status based on the status of the interface.
- Variables:
id – The id of the output data attribute
latest_timestamp_output – The latest timestamp of the output data from the query or None, if the data is not available
Show JSON schema
{ "title": "OutputDataAttributeModel", "description": "Model for a attribute of output data of the system controller - status based on the status of the interface.\n\nAttributes:\n id: The id of the output data attribute\n latest_timestamp_output: The latest timestamp of the output data from the query or None, if the data is not available", "type": "object", "properties": { "id": { "title": "Id", "type": "string" }, "latest_timestamp_output": { "anyOf": [ { "format": "date-time", "type": "string" }, { "type": "null" } ], "default": null, "title": "Latest Timestamp Output" } }, "required": [ "id" ] }
- pydantic model encodapy.utils.models.OutputDataEntityModel[source]
Model for the status of the output data of the system controller.
- Variables:
id – The id of the output entity
latest_timestamp_output – The latest timestamp of the output data from the query or None, if the data is not available
attributes – List of the output data attributes as OutputDataAttributeModel
commands – List of the output data commands as OutputDataCommandModel
Show JSON schema
{ "title": "OutputDataEntityModel", "description": "Model for the status of the output data of the system controller.\n\nAttributes:\n id: The id of the output entity\n latest_timestamp_output: The latest timestamp of the output data from the query or None, if the data is not available\n attributes: List of the output data attributes as OutputDataAttributeModel\n commands: List of the output data commands as OutputDataCommandModel", "type": "object", "properties": { "id": { "title": "Id", "type": "string" }, "attributes": { "anyOf": [ { "items": { "$ref": "#/$defs/AttributeModel" }, "type": "array" }, { "type": "null" } ], "default": [], "title": "Attributes" }, "attributes_status": { "anyOf": [ { "items": { "$ref": "#/$defs/OutputDataAttributeModel" }, "type": "array" }, { "type": "null" } ], "default": [], "title": "Attributes Status" }, "commands": { "anyOf": [ { "items": { "$ref": "#/$defs/CommandModel" }, "type": "array" }, { "type": "null" } ], "default": [], "title": "Commands" } }, "$defs": { "AttributeModel": { "description": "Configuration class for representing attributes with metadata, value, and optional interface-specific identifier.\n\nThis class models attributes with a unique ID, type, value, unit, and timestamp.\nIf `id_interface` is not set, it defaults to the value of `id`.\n\nAttributes:\n id (str): The unique identifier of the attribute.\n id_interface (str): The interface-specific identifier. Defaults to `None`.\n If not set, it will be automatically set to the value of `id`.\n type (AttributeTypes): The type of the attribute. Defaults to `AttributeTypes.VALUE`.\n value (Union[str, float, int, bool, Dict, List, pd.DataFrame, None]): The value of the attribute. Defaults to `None`.\n unit (Optional[DataUnits]): The unit of measurement for the value. Defaults to `None`.\n datatype (DataType): The data type of the attribute. Defaults to `DataType(\"Number\")`.\n timestamp (Optional[datetime]): The timestamp of the attribute. Defaults to `None`.\n mqtt_format (Union[MQTTFormatTypes, MQTTTemplateConfig]): The format of the attribute for MQTT (if not set, the default format is used) - only for mqtt interface needed", "properties": { "id": { "title": "Id", "type": "string" }, "id_interface": { "default": "", "title": "Id Interface", "type": "string" }, "type": { "allOf": [ { "$ref": "#/$defs/AttributeTypes" } ], "default": "value" }, "value": { "anyOf": [ { "type": "string" }, { "type": "number" }, { "type": "integer" }, { "type": "boolean" }, { "type": "object" }, { "items": {}, "type": "array" }, { "type": "null" } ], "default": null, "title": "Value" }, "unit": { "anyOf": [ { "$ref": "#/$defs/DataUnits" }, { "type": "null" } ], "default": null }, "datatype": { "allOf": [ { "$ref": "#/$defs/DataType" } ], "default": "Number" }, "timestamp": { "anyOf": [ { "format": "date-time", "type": "string" }, { "type": "null" } ], "default": null, "title": "Timestamp" }, "mqtt_format": { "anyOf": [ { "$ref": "#/$defs/MQTTFormatTypes" }, { "$ref": "#/$defs/MQTTTemplateConfigDoc" } ], "default": "plain", "title": "Mqtt Format" } }, "required": [ "id" ], "title": "AttributeModel", "type": "object" }, "AttributeTypes": { "description": "Enum class for the attribute types\n\nAttributes:\n TIMESERIES (str): Timeseries data \"timeseries\"\n VALUE (str): Single value data \"value\"", "enum": [ "timeseries", "value" ], "title": "AttributeTypes", "type": "string" }, "CommandModel": { "description": "Configuration class for the commands\n\nAttributes:\n id (str): The id of the command\n id_interface (str | None): The id of the command on the interface (if not set, the id is used)\n value (Union[str, int, float, List, Dict, None]): The value of the command", "properties": { "id": { "title": "Id", "type": "string" }, "id_interface": { "default": "", "title": "Id Interface", "type": "string" }, "value": { "anyOf": [ { "type": "string" }, { "type": "integer" }, { "type": "number" }, { "items": {}, "type": "array" }, { "type": "object" }, { "type": "null" } ], "default": null, "title": "Value" } }, "required": [ "id" ], "title": "CommandModel", "type": "object" }, "DataType": { "description": "When possible reuse schema.org data types\n(Text, Number, DateTime, StructuredValue, etc.).\nRemember that null is not allowed in NGSI-LD and\ntherefore should be avoided as a value.\n\nhttps://schema.org/DataType", "enum": [ "Boolean", "Date", "DateTime", "Number", "Integer", "Float", "Text", "Time", "Relationship", "StructuredValue", "Array", "Object", "command", "commandResult", "commandStatus", "geo:json" ], "title": "DataType", "type": "string" }, "DataUnits": { "description": "Possible units for the data\nUnits which are defined by Unit Code (https://unece.org/trade/cefact/UNLOCODE-Download\nor https://github.com/RWTH-EBC/FiLiP/blob/master/filip/data/unece-units/units_of_measure.csv)\nor here: https://unece.org/fileadmin/DAM/cefact/recommendations/rec20/rec20_rev3_Annex3e.pdf\nTODO:\n - Is there a better way to handle the units?\n - Add more units?", "enum": [ "SEC", "HUR", "MIN", "CEL", "KEL", "LTR", "MTQ", "MQH", "MQS", "E32", "L2", "WTT", "WHR", "KWH", "CMT", "MTR", "MTK", "MTS", "P1", "OHM", "VLT" ], "title": "DataUnits", "type": "string" }, "MQTTFormatTypes": { "description": "Enum class for MQTT format types\nPossible values:\n- PLAIN (plain): Plain format\n- FIWARE_ATTR (fiware-attr): FIWARE attribute format\n- FIWARE_CMDEXE (fiware-cmdexe): FIWARE command execution format\n- TEMPLATE (template): Template-based format", "enum": [ "plain", "fiware-attr", "fiware-cmdexe", "template" ], "title": "MQTTFormatTypes", "type": "string" }, "MQTTTemplateConfigDoc": { "description": "Model for MQTT template configuration.\n\n**Mock class for documentation purposes.**\n\nNote:\n In the actual implementation, `topic` and `payload` are `jinja2.Template` objects,\n `time_format` is a `str` as time format for the timestamp in the payload.\n This mock uses `dict` to avoid import issues during documentation generation.\n \n For more information, see :class:`~encodapy.config.mqtt_messages_template.MQTTTemplateConfig`.", "properties": { "topic": { "title": "Topic", "type": "object" }, "payload": { "title": "Payload", "type": "object" }, "time_format": { "default": "%Y-%m-%dT%H:%M:%S%z", "title": "Time Format", "type": "string" } }, "required": [ "topic", "payload" ], "title": "MQTTTemplateConfigDoc", "type": "object" }, "OutputDataAttributeModel": { "description": "Model for a attribute of output data of the system controller - status based on the status of the interface.\n\nAttributes:\n id: The id of the output data attribute\n latest_timestamp_output: The latest timestamp of the output data from the query or None, if the data is not available", "properties": { "id": { "title": "Id", "type": "string" }, "latest_timestamp_output": { "anyOf": [ { "format": "date-time", "type": "string" }, { "type": "null" } ], "default": null, "title": "Latest Timestamp Output" } }, "required": [ "id" ], "title": "OutputDataAttributeModel", "type": "object" } }, "required": [ "id" ] }
-
field attributes:
Optional[List[AttributeModel]] = []
-
field attributes_status:
Optional[List[OutputDataAttributeModel]] = []
-
field commands:
Optional[List[CommandModel]] = []
- pydantic model encodapy.utils.models.OutputDataModel[source]
Model for the output data of the system controller.
- Variables:
entities – List of the output data entitys as OutputDataEntityModel
Show JSON schema
{ "title": "OutputDataModel", "description": "Model for the output data of the system controller.\n\nAttributes:\n entities: List of the output data entitys as OutputDataEntityModel", "type": "object", "properties": { "entities": { "items": { "$ref": "#/$defs/OutputDataEntityModel" }, "title": "Entities", "type": "array" } }, "$defs": { "AttributeModel": { "description": "Configuration class for representing attributes with metadata, value, and optional interface-specific identifier.\n\nThis class models attributes with a unique ID, type, value, unit, and timestamp.\nIf `id_interface` is not set, it defaults to the value of `id`.\n\nAttributes:\n id (str): The unique identifier of the attribute.\n id_interface (str): The interface-specific identifier. Defaults to `None`.\n If not set, it will be automatically set to the value of `id`.\n type (AttributeTypes): The type of the attribute. Defaults to `AttributeTypes.VALUE`.\n value (Union[str, float, int, bool, Dict, List, pd.DataFrame, None]): The value of the attribute. Defaults to `None`.\n unit (Optional[DataUnits]): The unit of measurement for the value. Defaults to `None`.\n datatype (DataType): The data type of the attribute. Defaults to `DataType(\"Number\")`.\n timestamp (Optional[datetime]): The timestamp of the attribute. Defaults to `None`.\n mqtt_format (Union[MQTTFormatTypes, MQTTTemplateConfig]): The format of the attribute for MQTT (if not set, the default format is used) - only for mqtt interface needed", "properties": { "id": { "title": "Id", "type": "string" }, "id_interface": { "default": "", "title": "Id Interface", "type": "string" }, "type": { "allOf": [ { "$ref": "#/$defs/AttributeTypes" } ], "default": "value" }, "value": { "anyOf": [ { "type": "string" }, { "type": "number" }, { "type": "integer" }, { "type": "boolean" }, { "type": "object" }, { "items": {}, "type": "array" }, { "type": "null" } ], "default": null, "title": "Value" }, "unit": { "anyOf": [ { "$ref": "#/$defs/DataUnits" }, { "type": "null" } ], "default": null }, "datatype": { "allOf": [ { "$ref": "#/$defs/DataType" } ], "default": "Number" }, "timestamp": { "anyOf": [ { "format": "date-time", "type": "string" }, { "type": "null" } ], "default": null, "title": "Timestamp" }, "mqtt_format": { "anyOf": [ { "$ref": "#/$defs/MQTTFormatTypes" }, { "$ref": "#/$defs/MQTTTemplateConfigDoc" } ], "default": "plain", "title": "Mqtt Format" } }, "required": [ "id" ], "title": "AttributeModel", "type": "object" }, "AttributeTypes": { "description": "Enum class for the attribute types\n\nAttributes:\n TIMESERIES (str): Timeseries data \"timeseries\"\n VALUE (str): Single value data \"value\"", "enum": [ "timeseries", "value" ], "title": "AttributeTypes", "type": "string" }, "CommandModel": { "description": "Configuration class for the commands\n\nAttributes:\n id (str): The id of the command\n id_interface (str | None): The id of the command on the interface (if not set, the id is used)\n value (Union[str, int, float, List, Dict, None]): The value of the command", "properties": { "id": { "title": "Id", "type": "string" }, "id_interface": { "default": "", "title": "Id Interface", "type": "string" }, "value": { "anyOf": [ { "type": "string" }, { "type": "integer" }, { "type": "number" }, { "items": {}, "type": "array" }, { "type": "object" }, { "type": "null" } ], "default": null, "title": "Value" } }, "required": [ "id" ], "title": "CommandModel", "type": "object" }, "DataType": { "description": "When possible reuse schema.org data types\n(Text, Number, DateTime, StructuredValue, etc.).\nRemember that null is not allowed in NGSI-LD and\ntherefore should be avoided as a value.\n\nhttps://schema.org/DataType", "enum": [ "Boolean", "Date", "DateTime", "Number", "Integer", "Float", "Text", "Time", "Relationship", "StructuredValue", "Array", "Object", "command", "commandResult", "commandStatus", "geo:json" ], "title": "DataType", "type": "string" }, "DataUnits": { "description": "Possible units for the data\nUnits which are defined by Unit Code (https://unece.org/trade/cefact/UNLOCODE-Download\nor https://github.com/RWTH-EBC/FiLiP/blob/master/filip/data/unece-units/units_of_measure.csv)\nor here: https://unece.org/fileadmin/DAM/cefact/recommendations/rec20/rec20_rev3_Annex3e.pdf\nTODO:\n - Is there a better way to handle the units?\n - Add more units?", "enum": [ "SEC", "HUR", "MIN", "CEL", "KEL", "LTR", "MTQ", "MQH", "MQS", "E32", "L2", "WTT", "WHR", "KWH", "CMT", "MTR", "MTK", "MTS", "P1", "OHM", "VLT" ], "title": "DataUnits", "type": "string" }, "MQTTFormatTypes": { "description": "Enum class for MQTT format types\nPossible values:\n- PLAIN (plain): Plain format\n- FIWARE_ATTR (fiware-attr): FIWARE attribute format\n- FIWARE_CMDEXE (fiware-cmdexe): FIWARE command execution format\n- TEMPLATE (template): Template-based format", "enum": [ "plain", "fiware-attr", "fiware-cmdexe", "template" ], "title": "MQTTFormatTypes", "type": "string" }, "MQTTTemplateConfigDoc": { "description": "Model for MQTT template configuration.\n\n**Mock class for documentation purposes.**\n\nNote:\n In the actual implementation, `topic` and `payload` are `jinja2.Template` objects,\n `time_format` is a `str` as time format for the timestamp in the payload.\n This mock uses `dict` to avoid import issues during documentation generation.\n \n For more information, see :class:`~encodapy.config.mqtt_messages_template.MQTTTemplateConfig`.", "properties": { "topic": { "title": "Topic", "type": "object" }, "payload": { "title": "Payload", "type": "object" }, "time_format": { "default": "%Y-%m-%dT%H:%M:%S%z", "title": "Time Format", "type": "string" } }, "required": [ "topic", "payload" ], "title": "MQTTTemplateConfigDoc", "type": "object" }, "OutputDataAttributeModel": { "description": "Model for a attribute of output data of the system controller - status based on the status of the interface.\n\nAttributes:\n id: The id of the output data attribute\n latest_timestamp_output: The latest timestamp of the output data from the query or None, if the data is not available", "properties": { "id": { "title": "Id", "type": "string" }, "latest_timestamp_output": { "anyOf": [ { "format": "date-time", "type": "string" }, { "type": "null" } ], "default": null, "title": "Latest Timestamp Output" } }, "required": [ "id" ], "title": "OutputDataAttributeModel", "type": "object" }, "OutputDataEntityModel": { "description": "Model for the status of the output data of the system controller.\n\nAttributes:\n id: The id of the output entity\n latest_timestamp_output: The latest timestamp of the output data from the query or None, if the data is not available\n attributes: List of the output data attributes as OutputDataAttributeModel\n commands: List of the output data commands as OutputDataCommandModel", "properties": { "id": { "title": "Id", "type": "string" }, "attributes": { "anyOf": [ { "items": { "$ref": "#/$defs/AttributeModel" }, "type": "array" }, { "type": "null" } ], "default": [], "title": "Attributes" }, "attributes_status": { "anyOf": [ { "items": { "$ref": "#/$defs/OutputDataAttributeModel" }, "type": "array" }, { "type": "null" } ], "default": [], "title": "Attributes Status" }, "commands": { "anyOf": [ { "items": { "$ref": "#/$defs/CommandModel" }, "type": "array" }, { "type": "null" } ], "default": [], "title": "Commands" } }, "required": [ "id" ], "title": "OutputDataEntityModel", "type": "object" } }, "required": [ "entities" ] }
-
field entities:
list[OutputDataEntityModel] [Required]
- pydantic model encodapy.utils.models.StaticDataEntityModel[source]
Model for the static data of the system controller, same like InputDataEntityModel.
- Variables:
id – The id of the input data entity
attributes – List of the input data attributes as InputDataAttributeModel
Show JSON schema
{ "title": "StaticDataEntityModel", "description": "Model for the static data of the system controller, same like InputDataEntityModel.\n\nAttributes:\n id: The id of the input data entity\n attributes: List of the input data attributes as InputDataAttributeModel", "type": "object", "properties": { "id": { "title": "Id", "type": "string" }, "attributes": { "items": { "$ref": "#/$defs/InputDataAttributeModel" }, "title": "Attributes", "type": "array" } }, "$defs": { "AttributeTypes": { "description": "Enum class for the attribute types\n\nAttributes:\n TIMESERIES (str): Timeseries data \"timeseries\"\n VALUE (str): Single value data \"value\"", "enum": [ "timeseries", "value" ], "title": "AttributeTypes", "type": "string" }, "DataUnits": { "description": "Possible units for the data\nUnits which are defined by Unit Code (https://unece.org/trade/cefact/UNLOCODE-Download\nor https://github.com/RWTH-EBC/FiLiP/blob/master/filip/data/unece-units/units_of_measure.csv)\nor here: https://unece.org/fileadmin/DAM/cefact/recommendations/rec20/rec20_rev3_Annex3e.pdf\nTODO:\n - Is there a better way to handle the units?\n - Add more units?", "enum": [ "SEC", "HUR", "MIN", "CEL", "KEL", "LTR", "MTQ", "MQH", "MQS", "E32", "L2", "WTT", "WHR", "KWH", "CMT", "MTR", "MTK", "MTS", "P1", "OHM", "VLT" ], "title": "DataUnits", "type": "string" }, "InputDataAttributeModel": { "description": "Model for a attribute of input data of the system controller.\n\nAttributes:\n id (str): The id of the input data attribute\n data (Union[str, float, int, bool, Dict, List, DataFrame, None]): The input data as a DataFrame or a single value\n unit (Union[DataUnits, None]): The unit of the input data\n data_type (AttributeTypes): The type of the input data (AttributeTypes)\n data_available (bool): If the data is available\n latest_timestamp_input (Union[datetime, None]): The latest timestamp of the input data from the query or None, if the data is not available", "properties": { "id": { "title": "Id", "type": "string" }, "data": { "anyOf": [ { "type": "string" }, { "type": "number" }, { "type": "integer" }, { "type": "boolean" }, { "type": "object" }, { "items": {}, "type": "array" }, { "type": "null" } ], "title": "Data" }, "unit": { "anyOf": [ { "$ref": "#/$defs/DataUnits" }, { "type": "null" } ], "default": null }, "data_type": { "$ref": "#/$defs/AttributeTypes" }, "data_available": { "title": "Data Available", "type": "boolean" }, "latest_timestamp_input": { "anyOf": [ { "format": "date-time", "type": "string" }, { "type": "null" } ], "title": "Latest Timestamp Input" } }, "required": [ "id", "data", "data_type", "data_available", "latest_timestamp_input" ], "title": "InputDataAttributeModel", "type": "object" } }, "required": [ "id", "attributes" ] }
Interface Communication Models
These models are used for communication between the basic service and the interfaces.
- pydantic model encodapy.utils.models.MetaDataModel[source]
Model for the metadata of datapoints of the controller.
- Variables:
timestamp – The timestamp of the data
unit – The unit of the data
Show JSON schema
{ "title": "MetaDataModel", "description": "Model for the metadata of datapoints of the controller.\n\nAttributes:\n timestamp: The timestamp of the data\n unit: The unit of the data", "type": "object", "properties": { "timestamp": { "anyOf": [ { "format": "date-time", "type": "string" }, { "type": "null" } ], "default": null, "title": "Timestamp" }, "unit": { "anyOf": [ { "$ref": "#/$defs/DataUnits" }, { "type": "null" } ], "default": null } }, "$defs": { "DataUnits": { "description": "Possible units for the data\nUnits which are defined by Unit Code (https://unece.org/trade/cefact/UNLOCODE-Download\nor https://github.com/RWTH-EBC/FiLiP/blob/master/filip/data/unece-units/units_of_measure.csv)\nor here: https://unece.org/fileadmin/DAM/cefact/recommendations/rec20/rec20_rev3_Annex3e.pdf\nTODO:\n - Is there a better way to handle the units?\n - Add more units?", "enum": [ "SEC", "HUR", "MIN", "CEL", "KEL", "LTR", "MTQ", "MQH", "MQS", "E32", "L2", "WTT", "WHR", "KWH", "CMT", "MTR", "MTK", "MTS", "P1", "OHM", "VLT" ], "title": "DataUnits", "type": "string" } } }
- pydantic model encodapy.utils.models.FiwareDatapointParameter[source]
Model for the Fiware datapoint parameter.
- Variables:
entity (
ContextEntity) – The entity of the datapointattribute (
AttributeModel) – The attribute of the datapointmetadata (
list[NamedMetadata]) – The metadata of the attribute
Show JSON schema
{ "title": "FiwareDatapointParameter", "description": "Model for the Fiware datapoint parameter.\n\nAttributes:\n entity (ContextEntity): The entity of the datapoint\n attribute (AttributeModel): The attribute of the datapoint\n metadata (list[NamedMetadata]): The metadata of the attribute", "type": "object", "properties": { "entity": { "$ref": "#/$defs/ContextEntity" }, "attribute": { "$ref": "#/$defs/AttributeModel" }, "metadata": { "items": { "$ref": "#/$defs/NamedMetadata" }, "title": "Metadata", "type": "array" } }, "$defs": { "AttributeModel": { "description": "Configuration class for representing attributes with metadata, value, and optional interface-specific identifier.\n\nThis class models attributes with a unique ID, type, value, unit, and timestamp.\nIf `id_interface` is not set, it defaults to the value of `id`.\n\nAttributes:\n id (str): The unique identifier of the attribute.\n id_interface (str): The interface-specific identifier. Defaults to `None`.\n If not set, it will be automatically set to the value of `id`.\n type (AttributeTypes): The type of the attribute. Defaults to `AttributeTypes.VALUE`.\n value (Union[str, float, int, bool, Dict, List, pd.DataFrame, None]): The value of the attribute. Defaults to `None`.\n unit (Optional[DataUnits]): The unit of measurement for the value. Defaults to `None`.\n datatype (DataType): The data type of the attribute. Defaults to `DataType(\"Number\")`.\n timestamp (Optional[datetime]): The timestamp of the attribute. Defaults to `None`.\n mqtt_format (Union[MQTTFormatTypes, MQTTTemplateConfig]): The format of the attribute for MQTT (if not set, the default format is used) - only for mqtt interface needed", "properties": { "id": { "title": "Id", "type": "string" }, "id_interface": { "default": "", "title": "Id Interface", "type": "string" }, "type": { "allOf": [ { "$ref": "#/$defs/AttributeTypes" } ], "default": "value" }, "value": { "anyOf": [ { "type": "string" }, { "type": "number" }, { "type": "integer" }, { "type": "boolean" }, { "type": "object" }, { "items": {}, "type": "array" }, { "type": "null" } ], "default": null, "title": "Value" }, "unit": { "anyOf": [ { "$ref": "#/$defs/DataUnits" }, { "type": "null" } ], "default": null }, "datatype": { "allOf": [ { "$ref": "#/$defs/DataType" } ], "default": "Number" }, "timestamp": { "anyOf": [ { "format": "date-time", "type": "string" }, { "type": "null" } ], "default": null, "title": "Timestamp" }, "mqtt_format": { "anyOf": [ { "$ref": "#/$defs/MQTTFormatTypes" }, { "$ref": "#/$defs/MQTTTemplateConfigDoc" } ], "default": "plain", "title": "Mqtt Format" } }, "required": [ "id" ], "title": "AttributeModel", "type": "object" }, "AttributeTypes": { "description": "Enum class for the attribute types\n\nAttributes:\n TIMESERIES (str): Timeseries data \"timeseries\"\n VALUE (str): Single value data \"value\"", "enum": [ "timeseries", "value" ], "title": "AttributeTypes", "type": "string" }, "ContextEntity": { "additionalProperties": true, "description": "Context entities, or simply entities, are the center of gravity in the\nFIWARE NGSI information model. An entity represents a thing, i.e., any\nphysical or logical object (e.g., a sensor, a person, a room, an issue in\na ticketing system, etc.). Each entity has an entity id.\nFurthermore, the type system of FIWARE NGSI enables entities to have an\nentity type. Entity types are semantic types; they are intended to describe\nthe type of thing represented by the entity. For example, a context\nentity #with id sensor-365 could have the type temperatureSensor.\n\nEach entity is uniquely identified by the combination of its id and type.\n\nThe entity id is specified by the object's id property, whose value\nis a string containing the entity id.\n\nThe entity type is specified by the object's type property, whose value\nis a string containing the entity's type name.\n\nEntity attributes are specified by additional properties, whose names are\nthe name of the attribute and whose representation is described by the\n\"ContextAttribute\"-model. Obviously, `id` and `type` are\nnot allowed as attribute names.\n\nExample::\n\n >>> data = {'id': 'MyId',\n 'type': 'MyType',\n 'my_attr': {'value': 20, 'type': 'Number'}}\n\n >>> entity = ContextEntity(**data)", "properties": { "id": { "description": "Id of an entity in an NGSI context broker. Allowed characters are the ones in the plain ASCII set, except the following ones: control characters, whitespace, &, ?, / and #.", "example": "Bcn-Welt", "maxLength": 256, "minLength": 1, "title": "Entity Id", "type": "string" }, "type": { "anyOf": [ { "type": "string" }, { "enum": [], "title": "Enum" } ], "description": "Id of an entity in an NGSI context broker. Allowed characters are the ones in the plain ASCII set, except the following ones: control characters, whitespace, &, ?, / and #.", "example": "Room", "maxLength": 256, "minLength": 1, "title": "Entity Type" } }, "required": [ "id", "type" ], "title": "ContextEntity", "type": "object" }, "DataType": { "description": "When possible reuse schema.org data types\n(Text, Number, DateTime, StructuredValue, etc.).\nRemember that null is not allowed in NGSI-LD and\ntherefore should be avoided as a value.\n\nhttps://schema.org/DataType", "enum": [ "Boolean", "Date", "DateTime", "Number", "Integer", "Float", "Text", "Time", "Relationship", "StructuredValue", "Array", "Object", "command", "commandResult", "commandStatus", "geo:json" ], "title": "DataType", "type": "string" }, "DataUnits": { "description": "Possible units for the data\nUnits which are defined by Unit Code (https://unece.org/trade/cefact/UNLOCODE-Download\nor https://github.com/RWTH-EBC/FiLiP/blob/master/filip/data/unece-units/units_of_measure.csv)\nor here: https://unece.org/fileadmin/DAM/cefact/recommendations/rec20/rec20_rev3_Annex3e.pdf\nTODO:\n - Is there a better way to handle the units?\n - Add more units?", "enum": [ "SEC", "HUR", "MIN", "CEL", "KEL", "LTR", "MTQ", "MQH", "MQS", "E32", "L2", "WTT", "WHR", "KWH", "CMT", "MTR", "MTK", "MTS", "P1", "OHM", "VLT" ], "title": "DataUnits", "type": "string" }, "MQTTFormatTypes": { "description": "Enum class for MQTT format types\nPossible values:\n- PLAIN (plain): Plain format\n- FIWARE_ATTR (fiware-attr): FIWARE attribute format\n- FIWARE_CMDEXE (fiware-cmdexe): FIWARE command execution format\n- TEMPLATE (template): Template-based format", "enum": [ "plain", "fiware-attr", "fiware-cmdexe", "template" ], "title": "MQTTFormatTypes", "type": "string" }, "MQTTTemplateConfigDoc": { "description": "Model for MQTT template configuration.\n\n**Mock class for documentation purposes.**\n\nNote:\n In the actual implementation, `topic` and `payload` are `jinja2.Template` objects,\n `time_format` is a `str` as time format for the timestamp in the payload.\n This mock uses `dict` to avoid import issues during documentation generation.\n \n For more information, see :class:`~encodapy.config.mqtt_messages_template.MQTTTemplateConfig`.", "properties": { "topic": { "title": "Topic", "type": "object" }, "payload": { "title": "Payload", "type": "object" }, "time_format": { "default": "%Y-%m-%dT%H:%M:%S%z", "title": "Time Format", "type": "string" } }, "required": [ "topic", "payload" ], "title": "MQTTTemplateConfigDoc", "type": "object" }, "NamedMetadata": { "description": "Model for metadata including a name", "properties": { "type": { "anyOf": [ { "anyOf": [ { "$ref": "#/$defs/DataType" }, { "type": "string" } ], "maxLength": 256, "minLength": 1 }, { "type": "null" } ], "default": null, "description": "a metadata type, describing the NGSI value type of the metadata value Allowed characters are the ones in the plain ASCII set, except the following ones: control characters, whitespace, &, ?, / and #.", "title": "metadata type" }, "value": { "anyOf": [ {}, { "type": "null" } ], "default": null, "description": "a metadata value containing the actual metadata", "title": "metadata value" }, "name": { "description": "a metadata name, describing the role of the metadata in the place where it occurs; for example, the metadata name accuracy indicates that the metadata value describes how accurate a given attribute value is. Allowed characters are the ones in the plain ASCII set, except the following ones: control characters, whitespace, &, ?, / and #.", "maxLength": 256, "minLength": 1, "title": "metadata name", "type": "string" } }, "required": [ "name" ], "title": "NamedMetadata", "type": "object" } }, "required": [ "entity", "attribute", "metadata" ] }
-
field entity:
ContextEntity[Required]
-
field attribute:
AttributeModel[Required]
-
field metadata:
list[NamedMetadata] [Required]
- pydantic model encodapy.utils.models.FiwareAuth[source]
Base model for the Fiware authentication.
- Variables:
Show JSON schema
{ "title": "FiwareAuth", "description": "Base model for the Fiware authentication.\n\nAttributes:\n client_id (str): The client id\n client_secret (str): The client secret\n token_url (str): The token url\n baerer_token (str): The baerer token", "type": "object", "properties": { "client_id": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "title": "Client Id" }, "client_secret": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "title": "Client Secret" }, "token_url": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "title": "Token Url" }, "baerer_token": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "title": "Baerer Token" } } }
- pydantic model encodapy.utils.models.FiwareParameter[source]
Model for the Fiware connection parameters.
- Variables:
Show JSON schema
{ "title": "FiwareParameter", "description": "Model for the Fiware connection parameters.\n\nAttributes:\n cb_url (str): The context broker url\n service (str): The service\n service_path (str): The service path\n authentication (Optional[Union[FiwareAuth, None]]): The authentication", "type": "object", "properties": { "cb_url": { "title": "Cb Url", "type": "string" }, "service": { "title": "Service", "type": "string" }, "service_path": { "title": "Service Path", "type": "string" }, "authentication": { "anyOf": [ { "$ref": "#/$defs/FiwareAuth" }, { "type": "null" } ], "default": null } }, "$defs": { "FiwareAuth": { "description": "Base model for the Fiware authentication.\n\nAttributes:\n client_id (str): The client id\n client_secret (str): The client secret\n token_url (str): The token url\n baerer_token (str): The baerer token", "properties": { "client_id": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "title": "Client Id" }, "client_secret": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "title": "Client Secret" }, "token_url": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "title": "Token Url" }, "baerer_token": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "title": "Baerer Token" } }, "title": "FiwareAuth", "type": "object" } }, "required": [ "cb_url", "service", "service_path" ] }
-
field authentication:
Optional[FiwareAuth] = None
- pydantic model encodapy.utils.models.DatabaseParameter[source]
Model for the database connection parameters.
- Variables:
crate_db_url (
str) – The CrateDB urlcrate_db_user (
Optional[str]) – The CrateDB usercrate_db_pw (
Optional[str]) – The CrateDB passwordcrate_db_ssl (
Optional[bool]) – The CrateDB ssl
Show JSON schema
{ "title": "DatabaseParameter", "description": "Model for the database connection parameters.\n\nAttributes:\n crate_db_url (str): The CrateDB url\n crate_db_user (Optional[str]): The CrateDB user\n crate_db_pw (Optional[str]): The CrateDB password\n crate_db_ssl (Optional[bool]): The CrateDB ssl", "type": "object", "properties": { "crate_db_url": { "title": "Crate Db Url", "type": "string" }, "crate_db_user": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "title": "Crate Db User" }, "crate_db_pw": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": "", "title": "Crate Db Pw" }, "crate_db_ssl": { "anyOf": [ { "type": "boolean" }, { "type": "null" } ], "default": true, "title": "Crate Db Ssl" } }, "required": [ "crate_db_url" ] }
- pydantic model encodapy.utils.models.FiwareConnectionParameter[source]
Model for the Fiware connection parameters.
- Variables:
fiware_params (
FiwareParameter) – The Fiware parametersdatabase_params (
DatabaseParameter) – The database parameters
Show JSON schema
{ "title": "FiwareConnectionParameter", "description": "Model for the Fiware connection parameters.\n\nAttributes:\n fiware_params (FiwareParameter): The Fiware parameters\n database_params (DatabaseParameter): The database parameters", "type": "object", "properties": { "fiware_params": { "$ref": "#/$defs/FiwareParameter" }, "database_params": { "$ref": "#/$defs/DatabaseParameter" } }, "$defs": { "DatabaseParameter": { "description": "Model for the database connection parameters.\n\nAttributes:\n crate_db_url (str): The CrateDB url\n crate_db_user (Optional[str]): The CrateDB user\n crate_db_pw (Optional[str]): The CrateDB password\n crate_db_ssl (Optional[bool]): The CrateDB ssl", "properties": { "crate_db_url": { "title": "Crate Db Url", "type": "string" }, "crate_db_user": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "title": "Crate Db User" }, "crate_db_pw": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": "", "title": "Crate Db Pw" }, "crate_db_ssl": { "anyOf": [ { "type": "boolean" }, { "type": "null" } ], "default": true, "title": "Crate Db Ssl" } }, "required": [ "crate_db_url" ], "title": "DatabaseParameter", "type": "object" }, "FiwareAuth": { "description": "Base model for the Fiware authentication.\n\nAttributes:\n client_id (str): The client id\n client_secret (str): The client secret\n token_url (str): The token url\n baerer_token (str): The baerer token", "properties": { "client_id": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "title": "Client Id" }, "client_secret": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "title": "Client Secret" }, "token_url": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "title": "Token Url" }, "baerer_token": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "title": "Baerer Token" } }, "title": "FiwareAuth", "type": "object" }, "FiwareParameter": { "description": "Model for the Fiware connection parameters.\n\nAttributes:\n cb_url (str): The context broker url\n service (str): The service\n service_path (str): The service path\n authentication (Optional[Union[FiwareAuth, None]]): The authentication", "properties": { "cb_url": { "title": "Cb Url", "type": "string" }, "service": { "title": "Service", "type": "string" }, "service_path": { "title": "Service Path", "type": "string" }, "authentication": { "anyOf": [ { "$ref": "#/$defs/FiwareAuth" }, { "type": "null" } ], "default": null } }, "required": [ "cb_url", "service", "service_path" ], "title": "FiwareParameter", "type": "object" } }, "required": [ "fiware_params", "database_params" ] }
-
field fiware_params:
FiwareParameter[Required]
-
field database_params:
DatabaseParameter[Required]