finpricing.utils.calendar#

Module Contents#

Classes#

DateGenRuleTypes

Generic enumeration.

Calendar

class finpricing.utils.calendar.DateGenRuleTypes[source]#

Bases: enum.Enum

Generic enumeration.

Derive from this class to define new enumerations.

FORWARD = 1#
BACKWARD = 2#
class finpricing.utils.calendar.Calendar(calendarType: finpricing.utils.holiday.CalendarTypes)[source]#
is_holiday(date: finpricing.utils.date.Date) bool[source]#
is_business_day(date: finpricing.utils.date.Date) bool[source]#

Return True if the date is a business day

Weekend or not is determined solely by the date itself. Holiday or not is determined by the calendar.

add_business_days(date: finpricing.utils.date.Date, num_days: int) finpricing.utils.date.Date[source]#

Return a new Date object by adding num_days business days to the date

adjust(date: finpricing.utils.date.Date, busDayAdjType: finpricing.utils.bus_day_adj.BusDayAdjustTypes) finpricing.utils.date.Date[source]#

Return a new Date object by adjusting the date according to the Business Day Convention

For details, https://jollycontrarian.com/index.php?title=Business_Day_Convention_-_ISDA_Definition