Structures

Classes

class badidatetime._structures.LongFormStruct(tm_kull_i_shay: int, tm_vahid: int, tm_year: int, tm_mon: int, tm_mday: int, tm_hour: int, tm_min: int, tm_sec: float, tm_wday: int, tm_yday: int, tm_isdst: int, tm_zone: str = None, tm_gmtoff: int = None)[source]

Bases: NamedTuple

Implements a long form Badí’ date and time NamedTuple.

_asdict()

Return a new dict which maps field names to their values.

_field_defaults = {'tm_gmtoff': None, 'tm_zone': None}
_fields = ('tm_kull_i_shay', 'tm_vahid', 'tm_year', 'tm_mon', 'tm_mday', 'tm_hour', 'tm_min', 'tm_sec', 'tm_wday', 'tm_yday', 'tm_isdst', 'tm_zone', 'tm_gmtoff')
classmethod _make(iterable)

Make a new LongFormStruct object from a sequence or iterable

_replace(**kwds)

Return a new LongFormStruct object replacing specified fields with new values

property short

Indicates if this NamedTuple is a short or long form Badí’ date.

tm_gmtoff: int

Alias for field number 12

tm_hour: int

Alias for field number 5

tm_isdst: int

Alias for field number 10

tm_kull_i_shay: int

Alias for field number 0

tm_mday: int

Alias for field number 4

tm_min: int

Alias for field number 6

tm_mon: int

Alias for field number 3

tm_sec: float

Alias for field number 7

tm_vahid: int

Alias for field number 1

tm_wday: int

Alias for field number 8

tm_yday: int

Alias for field number 9

tm_year: int

Alias for field number 2

tm_zone: str

Alias for field number 11

class badidatetime._structures.ShortFormStruct(tm_year: int, tm_mon: int, tm_mday: int, tm_hour: int, tm_min: int, tm_sec: float, tm_wday: int, tm_yday: int, tm_isdst: int, tm_zone: str = None, tm_gmtoff: int = None)[source]

Bases: NamedTuple

Implements a short form Badí’ date and time NamedTuple.

_asdict()

Return a new dict which maps field names to their values.

_field_defaults = {'tm_gmtoff': None, 'tm_zone': None}
_fields = ('tm_year', 'tm_mon', 'tm_mday', 'tm_hour', 'tm_min', 'tm_sec', 'tm_wday', 'tm_yday', 'tm_isdst', 'tm_zone', 'tm_gmtoff')
classmethod _make(iterable)

Make a new ShortFormStruct object from a sequence or iterable

_replace(**kwds)

Return a new ShortFormStruct object replacing specified fields with new values

property short

Indicates if this NamedTuple is a short or long form Badí’ date.

tm_gmtoff: int

Alias for field number 10

tm_hour: int

Alias for field number 3

tm_isdst: int

Alias for field number 8

tm_mday: int

Alias for field number 2

tm_min: int

Alias for field number 4

tm_mon: int

Alias for field number 1

tm_sec: float

Alias for field number 5

tm_wday: int

Alias for field number 6

tm_yday: int

Alias for field number 7

tm_year: int

Alias for field number 0

tm_zone: str

Alias for field number 9

class badidatetime._structures.struct_time(date: tuple, tzinfo=None)[source]

Bases: object

Create a structure representing a Badí’ date and time.

classmethod __fill_in_missing(date: tuple, tzinfo, short: bool)

Fill in missing data.

Parameters:
  • date (tuple) – The date tuple to be processed.

  • tzinfo (tzinfo) – Timezone information or None.

  • short (bool) – If True then the date tuple represents a short form Badí’ date and time, if False date tuple represents a long form Badí’ date and time.

Returns:

The updated date tuple.

Return type:

tuple

classmethod __is_short_form(date: tuple)

Determines if the date tuple contains short or long form data.

Parameters:

date (tuple) – The date tuple to be processed.

Returns:

If True then the date tuple represents a short form Badí’ date and time, if False date tuple represents a long form Badí’ date and time.

Return type:

bool

Raises:

TypeError – Wrong tuple sequence size.