Asset Utils#
OpenFactory Assets helper functions.
- class openfactory.assets.utils.AssetAttribute(value, type, tag, timestamp=<factory>)[source]#
Bases:
objectRepresents a single attribute of an asset, including its value, type, tag, and timestamp.
- type#
The category/type of the attribute, must be one of the allowed literal strings.
- Type:
Literal[‘Samples’, ‘Condition’, ‘Events’, ‘Method’, ‘OpenFactory’, ‘UNAVAILABLE’]
- timestamp#
Timestamp when the attribute was recorded, in OpenFactory format. Defaults to the current timestamp if not provided.
- Type:
- __init__(value, type, tag, timestamp=<factory>)#
- openfactory.assets.utils.current_timestamp()[source]#
Returns the current timestamp in OpenFactory format.
The format is ISO 8601 with milliseconds precision and a ‘Z’ to indicate UTC time, e.g., ‘2025-05-04T12:34:56.789Z’.
- Return type:
- Returns:
str – The current UTC timestamp formatted in OpenFactory style.