Skip to content

global_fetch_params

Classes:

Name Description
GlobalFetchParams

Classes#

GlobalFetchParams #

Bases: BaseModel

Methods:

Name Description
default_to_seconds
get_direction

Attributes:

Name Type Description
time_padding Optional[str]

How far in time to look ahead (+), behind (-), or both to search

Attributes#

time_padding instance-attribute #
time_padding: Optional[str]

How far in time to look ahead (+), behind (-), or both to search for files.

Functions#

default_to_seconds #
default_to_seconds(d: str) -> str
Source code in tsdat/io/retrievers/global_fetch_params.py
@validator("time_padding", pre=True)
def default_to_seconds(cls, d: str) -> str:
    if not d:
        return ""
    elif d[-1].isnumeric():
        return d + "s"
    else:
        return d
get_direction staticmethod #
get_direction(d: str) -> tuple[int, str]
Source code in tsdat/io/retrievers/global_fetch_params.py
@staticmethod
def get_direction(d: str) -> tuple[int, str]:
    if "+" in d:
        return 1, d.replace("+", "")
    elif "-" in d:
        return -1, d.replace("-", "")
    else:
        return 0, d