nemo_microservices._utils._datetime_parse#

This file contains code from https://github.com/pydantic/pydantic/blob/main/pydantic/v1/datetime_parse.py without the Pydantic v1 specific errors.

Module Contents#

Functions#

parse_date

Parse a date/int/float/string and return a datetime.date.

parse_datetime

Parse a datetime/int/float/string and return a datetime.datetime.

Data#

API#

nemo_microservices._utils._datetime_parse.EPOCH#

‘datetime(…)’

nemo_microservices._utils._datetime_parse.MAX_NUMBER#

‘int(…)’

nemo_microservices._utils._datetime_parse.MS_WATERSHED#

‘int(…)’

nemo_microservices._utils._datetime_parse.date_expr#

‘(?P\d{4})-(?P\d{1,2})-(?P\d{1,2})’

nemo_microservices._utils._datetime_parse.date_re#

‘compile(…)’

nemo_microservices._utils._datetime_parse.datetime_re#

‘compile(…)’

nemo_microservices._utils._datetime_parse.parse_date(
value: datetime.date | nemo_microservices._types.StrBytesIntFloat,
) datetime.date#

Parse a date/int/float/string and return a datetime.date.

Raise ValueError if the input is well formatted but not a valid date. Raise ValueError if the input isn’t well formatted.

nemo_microservices._utils._datetime_parse.parse_datetime(
value: datetime.datetime | nemo_microservices._types.StrBytesIntFloat,
) datetime.datetime#

Parse a datetime/int/float/string and return a datetime.datetime.

This function supports time zone offsets. When the input contains one, the output uses a timezone with a fixed offset from UTC.

Raise ValueError if the input is well formatted but not a valid datetime. Raise ValueError if the input isn’t well formatted.

nemo_microservices._utils._datetime_parse.time_expr#

‘(?P\d{1,2}):(?P\d{1,2})(?::(?P\d{1,2})(?:.(?P\d{1,6})\d{0,6})?)?…’