Skip to content

Reference

Date Module

datetime_to_iso8601_with_z_suffix(value)

Convert datetime to ISO 8601 with Z suffix.

Parameters:

Name Type Description Default
value datetime

datetime object to be converted.

required

Returns:

Name Type Description
str str

ISO 8601 formatted datetime with Z suffix.

day_of_week_to_int(day_of_week)

Convert day of week to int.

days_of_week_to_int(days_of_week)

Convert days of week to int.

days_since(timestamp)

Get the number of days since a timestamp.

is_today_not_in_days_of_week(days_of_week)

Check if today is not in the days of week.

normalize_str_datetime(value)

Convert string to normalized datetime in str.

now(tz=timezone.utc, **kwargs)

Get current datetime with timezone.

Parameters:

Name Type Description Default
tz timezone

timezone.

utc
**kwargs dict

Arbitrary keyword arguments that will be passed to timedelta.

{}

Returns:

Name Type Description
datetime datetime

current datetime object with timezone and offset.

now_str(**kwargs)

Get current datetime as string.

str_to_datetime(value)

Convert string to datetime.

FastAPI Module

CustomFastAPI

Bases: FastAPI

Custom FastAPI class.

FastAPIRequest

Bases: Request

Custom FastAPI Request class.