Date and Calendar

Date Offset

class cred.Monthly(months=1)

Monthly date offset that recognizes whether it is added to the last day of the month. If so, returns the last day of the corresponding month. Convenience offset for interest periods that may roll on the last day of the month.

Example: adding Monthly() to date(2020, 6, 30) returns date(2020, 7, 31). The default object is a one month offset.

Parameters:months (int) – Offset in months.

Business Day Calendars

cred.FederalReserveHolidays(name=None, rules=None)

U.S. Federal Reserve banking holidays. Holidays are thought to be accurate, but you should verify independently.

cred.LondonBankHolidays(name=None, rules=None)

London banking holidays. Holidays are thought to be accurate, but you should verify independently.

Date Adjustment Conventions

cred.unadjusted(dt, holidays=None)

Return unadjusted date. calendar parameter does not affect return value, provides consistency with other convention functions.

cred.modified_following(dt, holidays)

Return the next business day if dt is on a weekend or holiday in holidays unless the next business day is in the following calendar month, in which case returns the previous business day.

cred.following(dt, holidays)

Return the next business day if dt is on a weekend or a date in holidays.

cred.preceding(dt, holidays)

Return the previous business day if dt is on a weekend or a date in holidays.