azely.time module#
- class Time(start: str = '00:00 today', stop: str = '00:00 tomorrow', step: str = '10min', timezone: str = '')[source]#
Bases:
object
Time information.
- Parameters:
start (str) – Left bound of the time (inclusive).
stop (str) – Right bound of the time (inclusive).
step (str) – Step of the time (pandas offset alias).
timezone (str) – Timezone of the time (IANA timezone name).
- property index: DatetimeIndex#
Convert it to a pandas DatetimeIndex.
- start: str = '00:00 today'#
Left bound of the time (inclusive).
- step: str = '10min'#
Step of the time (pandas offset alias).
- stop: str = '00:00 tomorrow'#
Right bound of the time (exclusive).
- timezone: str = ''#
Timezone of the time (IANA timezone name).
- class TimeDict[source]#
Bases:
TypedDict
Dictionary of the time information attributes.
- start: NotRequired[str]#
- step: NotRequired[str]#
- stop: NotRequired[str]#
- timezone: NotRequired[str]#
- get_time(query: str, /, *, sep: str = '\\s*;\\s*', append: bool = True, overwrite: bool = False, source: PathLike[str] | str | None = None) Time [source]#
Parse given query to create time information.
- Parameters:
query (str) – Query string for the time information.
sep (str) – Separator string for splitting the query.
append (bool) – Whether to append the time information to the source TOML file if it does not exist.
overwrite (bool) – Whether to overwrite the time information to the source TOML file even if it already exists.
source (PathLike[str] | str | None) – Path of a source TOML file for the time information.
- Returns:
Time information created from the parsed query.
- Return type: