Source code for kappa_sdk.metadata
from datetime import datetime
from typing import Optional
[docs]
class Metadata:
""" Metadata object.
Presents a KAPPA Automate vector metadata object
.. note:: Should not be instantiated directly.
"""
def __init__(self,
user_measure_id: Optional[str],
is_by_step: bool,
first_x: Optional[datetime],
min_y: Optional[float],
max_y: Optional[float],
is_step_at_start: bool,
name: str,
count: int,
min_x: Optional[datetime] = None,
max_x: Optional[datetime] = None,
cumulative_vector_id: Optional[str] = None):
self.__user_measure_id: Optional[str] = user_measure_id
self.__is_by_step: bool = is_by_step
self.__first_x: Optional[datetime] = first_x
self.__min_y: Optional[float] = min_y
self.__max_y: Optional[float] = max_y
self.__is_step_at_start: bool = is_step_at_start
self.__name: str = name
self.__count: int = count
self.__min_x: Optional[datetime] = min_x
self.__max_x: Optional[datetime] = max_x
self.__cumulative_vector_id: Optional[str] = cumulative_vector_id
@property
def user_measure_id(self) -> Optional[str]:
""" Gets the user measure id for this :class:`Metadata`."""
return self.__user_measure_id
@property
def is_by_step(self) -> bool:
""" A value indicating whether this class:`Metadata` is a step data or not."""
return self.__is_by_step
@property
def first_x(self) -> Optional[datetime]:
""" Gets the first X for this :class:`Metadata`."""
return self.__first_x
@property
def min_y(self) -> Optional[float]:
""" Gets the minimum Y for this :class:`Metadata`."""
return self.__min_y
@property
def max_y(self) -> Optional[float]:
""" Gets the maximum Y for this :class:`Metadata`."""
return self.__max_y
@property
def is_step_at_start(self) -> bool:
""" A value indicating whether this class:`Metadata` is a step at start data or not."""
return self.__is_step_at_start
@property
def name(self) -> str:
""" Gets name for this :class:`Metadata`"""
return self.__name
@property
def count(self) -> int:
""" Gets number of points for this :class:`Metadata`"""
return self.__count
@property
def min_x(self) -> Optional[datetime]:
""" Gets minimum X for this :class:`Metadata`"""
return self.__min_x
@property
def max_x(self) -> Optional[datetime]:
""" Gets maximum X for this :class:`Metadata`"""
return self.__max_x
@property
def cumulative_vector_id(self) -> Optional[str]:
""" Gets cumulative vector id for this :class:`Metadata`"""
return self.__cumulative_vector_id