semantique.time_interval

Contents

semantique.time_interval#

semantique.time_interval(a, b, **kwargs)[source]#

Time interval.

Object representing a set of timestamps that fall inside the given bounds of a time interval. The interval is closed at both sides, meaning that both of its bounds belong to the set. By definition, the given bounds should be time instants, and the lower bound should be smaller than or equal to the upper bound.

Parameters:
  • a – The lower bound of the interval, which should be a time instant formatted as an object that can be understood by the initializer of TemporalExtent. This includes pandas.Timestamp objects, as well as text representations of time instants in different formats.

  • b – The upper bound of the interval, which should be a time instant formatted as an object that can be understood by the initializer of TemporalExtent. This includes pandas.Timestamp objects, as well as text representations of time instants in different formats.

  • **kwargs – Additional keyword arguments passed on to the initializer of TemporalExtent.

Returns:

dict – JSON-serializable object that contains the bounds of the time interval, and can be understood by the query processor as such.

Examples

>>> import semantique as sq
>>> sq.time_interval("2021-01-01", "2021-12-31")