quantlib.time.date.

Period

class Period(*args)

Bases: object

Class providing a Period (length + time unit) class and implements a limited algebra.

Parameters:
*args
  • Period(period_string): Create a period from a string, e.g., “2m” or “3y”.

  • Period(frequency): Create a period from a Frequency enum.

  • Period(length, time_unit): Create a period from a length and a TimeUnit.

  • Period(): Create an empty period.

Attributes:
frequency

The frequency of the period.

length

The length of the period.

units

The time unit of the period.

Methods

normalize(self)

Normalizes the units of the period.