Data models

class enlyze.models.Site[source]

Representation of a site in the ENLYZE platform.

Contains details about the site.

uuid: UUID

Stable identifier of the site.

display_name: str

Display name of the site.

class enlyze.models.Machine[source]

Representation of a machine in the ENLYZE platform.

Contains details about the machine.

uuid: UUID

Stable identifier of the machine.

display_name: str

Display name of the machine.

genesis_date: date

The date when the machine has been connected to the ENLYZE platform.

site: Site

The site where the machine is located.

class enlyze.models.Variable[source]

Representation of a variable in the ENLYZE platform.

Contains details about the variable, but no timeseries data.

uuid: UUID

Stable identifier of the variable.

display_name: str | None

Display name of the variable.

unit: str | None

Unit of the measure that the variable represents.

data_type: VariableDataType

The underlying data type of the variable.

machine: Machine

The machine on which this variable is read out.

class enlyze.models.VariableDataType[source]

Enumeration of variable data types. Compares to strings out-of-the-box:

>>> VariableDataType.INTEGER == 'INTEGER'
True
INTEGER = 'INTEGER'
FLOAT = 'FLOAT'
BOOLEAN = 'BOOLEAN'
STRING = 'STRING'
ARRAY_INTEGER = 'ARRAY_INTEGER'
ARRAY_FLOAT = 'ARRAY_FLOAT'
ARRAY_BOOLEAN = 'ARRAY_BOOLEAN'
ARRAY_STRING = 'ARRAY_STRING'
class enlyze.models.TimeseriesData[source]

Result of a request for timeseries data.

start: datetime

Start of the requested time frame.

end: datetime

End of the requested time frame.

variables: Sequence[Variable]

The variables for which timeseries data has been requested.

to_dicts(use_display_names=False)[source]

Convert timeseries data into rows of dict.

Each row is returned as a dictionary with variable UUIDs as keys. Additionally, the time column is always present, containing timezone-aware datetime.datetime localized in UTC.

Parameters:

use_display_names (bool) – Whether to return display names instead of variable UUIDs. If there is no display name, fall back to UUID.

Returns:

Iterator over rows

Raises:

DuplicateDisplayNameError when duplicate display names would be returned instead of UUIDs.

Return type:

Iterator[dict[str, Any]]

to_dataframe(use_display_names=False)[source]

Convert timeseries data into pandas.DataFrame

The data frame will have an index named time that consists of timezone-aware datetime.datetime localized in UTC. Each requested variables is represented as a column named by its UUID.

Parameters:

use_display_names (bool) – Whether to return display names instead of variable UUIDs. If there is no display name, fall back to UUID.

Returns:

DataFrame with timeseries data indexed by time

Raises:

DuplicateDisplayNameError when duplicate display names would be returned instead of UUIDs.

Return type:

DataFrame

class enlyze.models.ResamplingMethod[source]

Resampling method to be used when resampling timeseries data.

FIRST = 'first'
LAST = 'last'
MAX = 'max'
MIN = 'min'
COUNT = 'count'
SUM = 'sum'
AVG = 'avg'
MEDIAN = 'median'
class enlyze.models.Quantity[source]

Representation of a physical quantity

unit: str | None

Physical unit of quantity

value: float

The quantity expressed in unit

class enlyze.models.OEEComponent[source]

Individual Overall Equipment Effectiveness (OEE) score

This is calculated by the ENLYZE platform based on a combination of real machine data and production order booking information provided by the customer.

For more information, please check out https://www.oee.com

score: float

The score is expressed as a ratio between 0 and 1.0, with 1.0 meaning 100 %.

time_loss: timedelta

Unproductive time due to non-ideal production.

class enlyze.models.Product[source]

Representation of a product that is produced on a machine

uuid: UUID

The UUID of the product

external_id: str

The identifier of the product in the external system it was synchronized from

name: str | None = None

An optional human-friendly name of the product

class enlyze.models.ProductionRun[source]

Representation of a production run in the ENLYZE platform.

Contains details about the production run.

uuid: UUID

The UUID of the production run

machine: Machine

The machine the production run was executed on.

average_throughput: float | None

The average throughput of the production run excluding downtimes.

production_order: str

The identifier of the production order in the external system it was synchronized from.

product: Product

The product that was produced.

start: datetime

The begin of the production run.

end: datetime | None

The end of the production run.

quantity_total: Quantity | None

This is the sum of scrap and yield.

quantity_scrap: Quantity | None

The amount of product produced that doesn’t meet quality criteria.

quantity_yield: Quantity | None

The amount of product produced that can be sold.

availability: OEEComponent | None

OEE component that reflects when the machine did not produce.

performance: OEEComponent | None

OEE component that reflects how fast the machine has run.

quality: OEEComponent | None

OEE component that reflects how much defects have been produced.

productivity: OEEComponent | None

Aggregate OEE score that comprises availability, performance and quality.

class enlyze.models.ProductionRuns[source]

Representation of multiple production runs.

to_dataframe()[source]

Convert production runs into pandas.DataFrame

Each row in the dataframe represents one production run. The start and end of every production run will be represented as timezone-aware datetime.datetime localized in UTC.

Returns:

DataFrame with production runs.

Return type:

DataFrame