UnionCal#

class rateslib.scheduling.UnionCal(calendars, settlement_calendars=None)#

Bases: object

A calendar defined by a business day intersection of multiple Cal objects.

Parameters:
  • calendars (list[Cal]) – A list of Cal objects whose combination will define the business and non-business days.

  • settlement_calendars (list[Cal]) – A list of Cal objects whose combination will define the settleable and non-settleable days.

Attributes Summary

calendars

A list of Cal objects defining business days.

holidays

A list of specifically provided non-business days.

settlement_calendars

A list of Cal objects defining settleable days.

week_mask

A list of days in the week defined as weekends.

Methods Summary

add_bus_days(date, days, settlement)

Return a business date separated by days from an input business date.

add_cal_days(date, days, adjuster)

Return a date separated by calendar days from input date, and rolled with a modifier.

add_months(date, months, adjuster, roll)

Return a date separated by months from an input date, and rolled with a modifier.

adjust(date, adjuster)

Adjust a non-business date to a business date under a specific modification rule.

adjusts(dates, adjuster)

Adjust a list of dates under a date adjustment rule.

bus_date_range(start, end)

Return a list of business dates in a range.

cal_date_range(start, end)

Return a list of calendar dates in a range.

is_bus_day(date)

Return whether the date is a business day.

is_non_bus_day(date)

Return whether the date is not a business day.

is_settlement(date)

Return whether the date is a business day in an associated settlement calendar.

lag_bus_days(date, days, settlement)

Adjust a date by a number of business days, under lag rules.

roll(date, modifier, settlement)

Roll a date under a simplified adjustment rule.

to_json()

Return a JSON representation of the object.

Attributes Documentation

calendars#

A list of Cal objects defining business days.

holidays#

A list of specifically provided non-business days.

settlement_calendars#

A list of Cal objects defining settleable days.

week_mask#

A list of days in the week defined as weekends.

Methods Documentation

add_bus_days(date, days, settlement)#

Return a business date separated by days from an input business date.

See Cal.add_bus_days.

add_cal_days(date, days, adjuster)#

Return a date separated by calendar days from input date, and rolled with a modifier.

See Cal.add_cal_days.

add_months(date, months, adjuster, roll)#

Return a date separated by months from an input date, and rolled with a modifier.

See Cal.add_months.

adjust(date, adjuster)#

Adjust a non-business date to a business date under a specific modification rule.

See Cal.adjust.

adjusts(dates, adjuster)#

Adjust a list of dates under a date adjustment rule.

See Cal.adjusts.

bus_date_range(start, end)#

Return a list of business dates in a range.

See Cal.bus_date_range.

cal_date_range(start, end)#

Return a list of calendar dates in a range.

See Cal.cal_date_range.

is_bus_day(date)#

Return whether the date is a business day.

See Cal.is_bus_day.

is_non_bus_day(date)#

Return whether the date is not a business day.

See Cal.is_non_bus_day.

is_settlement(date)#

Return whether the date is a business day in an associated settlement calendar.

If no such associated settlement calendar exists this will return True.

See Cal.is_settlement.

lag_bus_days(date, days, settlement)#

Adjust a date by a number of business days, under lag rules.

See Cal.lag_bus_days.

roll(date, modifier, settlement)#

Roll a date under a simplified adjustment rule.

See Cal.roll.

to_json()#

Return a JSON representation of the object.

Return type:

str