__init__

init_leap_cache

badidatetime.init_leap_cache()[source]

Initialize variables used to find Rata Die.

enable_geocoder

badidatetime.enable_geocoder(enable: bool = True) None[source]

Enable or disable the geocode query to find the local latitude, longitude, and time zone. If this function is never run then the defaults for datetime.LOCAL_COORD and datetime.LOCAL will be the Tehran Iran locale.

Parameters:

enable (bool) – If True (default) geocoder is run else if False it is not run.

_local_timezone_info

badidatetime._local_timezone_info()[source]

Returns the offset in seconds, dst, IANA timezone key.

Returns:

Offset in seconds, True or False for dst, and the IANA key.

Return type:

tuple

Note

Currently this must use the Python built in datetime, because the tzlocal package does not work completely with the Badí’ datetime package.

_get_local_coordinates

badidatetime._get_local_coordinates() tuple[source]

Get the locales coordinates and timezone offset for generating the Rata Die.

Returns:

The latitude, longitude, and the offset in hours.

Return type:

tuple