# XmlPeriod

class xsdata.models.datatype.XmlPeriod(value)

  Concrete xs:gYear/Month/Day builtin type.

  Represents iso 8601 period formats with rich comparisons and hashing.

  Formats:

    - xs:gDay: —%d%z

    - xs:gMonth: –%m%z

    - xs:gYear: %Y%z

    - xs:gMonthDay: –%m-%d%z

    - xs:gYearMonth: %Y-%m%z

  Parameters:

    value (`str`) – String representation of a xs:period, eg –11-01Z

  property year: int | None

    Period year.

  property month: int | None

    Period month.

  property day: int | None

    Period day.

  property offset: int | None

    Period timezone offset in minutes.

  as_dict()

    Return date units as dict.

    Return type:

      `Dict`

  __eq__(other)

    Return self==value.

    Return type:

      `bool`

  classmethod __class_getitem__()

    Represent a PEP 585 generic type

    E.g. for t = list[int], t.__origin__ is list and t.__args__ is (int,).

  __ge__(string)

    Return self>=value.

  __gt__(string)

    Return self>value.

  __hash__ = None
  __le__(string)

    Return self<=value.

  __lt__(string)

    Return self<value.

  __str__()

    Return str(self).

  classmethod __subclasshook__(C)

    Abstract classes can override this to customize issubclass().

    This is invoked early on by abc.ABCMeta.__subclasscheck__(). It should return True, False or NotImplemented. If it returns NotImplemented, the normal algorithm is used. Otherwise, it overrides the normal algorithm (and the outcome is cached).

  count(value) → integer -- return number of occurrences of value
  index(value[, start[, stop]]) → integer -- return first index of value.

    Raises ValueError if the value is not present.

    Supporting start and stop arguments is optional, but recommended.

  maketrans()

    Return a translation table usable for str.translate().

    If there is only one argument, it must be a dictionary mapping Unicode ordinals (integers) or characters to Unicode ordinals, strings or None. Character keys will be then converted to ordinals. If there are two arguments, they must be strings of equal length, and in the resulting dictionary, each character in x will be mapped to the character at the same position in y. If there is a third argument, it must be a string, whose characters will be mapped to None in the result.