pytimber.LoggingDB.get_variable
- LoggingDB.get_variable(variable: str, t1: Union[str, datetime, datetime64, timedelta, int, int64, float], t2: Optional[Union[str, datetime, datetime64, timedelta, int, int64, float]] = None, fundamental: Optional[Union[str, Fundamentals]] = None, unix_time: bool = True) Tuple[Tuple[ndarray, ndarray], ndarray]
Query for a specific variable within a time window and with the option to filter by fundamentals and return corresponding variable data. Similar to get method. Refer to get documentation for more details.
- Parameters:
variable – The variable name, as a string.
t1 – The start time of the time window, as a str, datetime, datetime64, timedelta, int, int64.
t2 – The end time of the time window, as a str, datetime, datetime64, timedelta, int, int64 or a strategy.
fundamental – An optional fundamentals object, to filter data points based on the fundamentals.
unix_time – Whether to return POSIX timestamps as float values. If True, return POSIX timestamps. If False, return datetime objects. Default value is True.
- Returns:
A tuple containing the arrays of timestamps and values for the queried variable. If unix_time is True, the timestamps are in POSIX format. Otherwise, they are datetime objects. If the query has no result, an empty tuple is returned.