module documentation

Undocumented

Function cached_tz Undocumented
Function match_to_datetime Convert a `RE_DATETIME` match to `datetime.datetime` or `datetime.date`.
Function match_to_localtime Undocumented
Function match_to_number Undocumented
Constant RE_DATETIME Undocumented
Constant RE_LOCALTIME Undocumented
Constant RE_NUMBER Undocumented
Constant _TIME_RE_STR Undocumented
@lru_cache(maxsize=None)
def cached_tz(hour_str: str, minute_str: str, sign_str: str) -> timezone: (source)

Undocumented

def match_to_datetime(match: re.Match) -> datetime|date: (source)

Convert a `RE_DATETIME` match to `datetime.datetime` or `datetime.date`. Raises ValueError if the match does not correspond to a valid date or datetime.

def match_to_localtime(match: re.Match) -> time: (source)

Undocumented

def match_to_number(match: re.Match, parse_float: ParseFloat) -> Any: (source)

Undocumented

RE_DATETIME = (source)

Undocumented

Value
re.compile(f"""
([0-9]{{4}})-(0[1-9]|1[0-2])-(0[1-9]|[12][0-9]|3[01])  # date, e.g. 1988-10-27
(?:
    [Tt ]
    {_TIME_RE_STR}
    (?:([Zz])|([+-])([01][0-9]|2[0-3]):([0-5][0-9]))?  # optional time offset
)?
...
RE_LOCALTIME = (source)

Undocumented

Value
re.compile(_TIME_RE_STR)
RE_NUMBER = (source)

Undocumented

Value
re.compile('''
0
(?:
    x[0-9A-Fa-f](?:_?[0-9A-Fa-f])*   # hex
    |
    b[01](?:_?[01])*                 # bin
    |
...
_TIME_RE_STR: str = (source)

Undocumented

Value
'([01][0-9]|2[0-3]):([0-5][0-9]):([0-5][0-9])(?:\\.([0-9]{1,6})[0-9]*)?'