FinancePy

FinancePy API Reference

Calendar

financepy.utils.calendar

Classes

BusDayAdjustTypes

BusDayAdjustTypes(*values)
Inherits from: Enum
Enum for business day adjustment types.

Calendar

Calendar(cal_type: financepy.utils.calendar.CalendarTypes | list | tuple)
Class to manage designation of payment dates as holidays according to a regional or country-specific calendar convention specified by the user. It also supplies an adjustment method which takes in an adjustment convention and then applies that to any date that falls on a holiday in the specified calendar.

Methods

adjust_cached

adjust_cached(self, dt: 'Date', bd_type: 'BusDayAdjustTypes') -> 'Date'

No description available.

adjust

adjust(self, dt: financepy.utils.date.Date, bd_type: financepy.utils.calendar.BusDayAdjustTypes)
Adjust a payment date if it falls on a holiday according to the specified business day convention.

fast_adjust

fast_adjust(self, dt: financepy.utils.date.Date, bd_type: financepy.utils.calendar.BusDayAdjustTypes)
Fast adjust a payment date using business day conventions.

add_business_days

add_business_days(self, start_dt: financepy.utils.date.Date, num_days: int)
Return the date num_days business days from start_dt. The start date itself is not counted.

add_business_days_old

add_business_days_old(self, start_dt: financepy.utils.date.Date, num_days: int)
Returns a new date that is num_days business days after Date. All holidays in the chosen calendar are assumed not business days.

is_business_day

is_business_day(self, dt: financepy.utils.date.Date)
Determines if a date is a business day according to the specified calendar. If it is it returns True, otherwise False.

is_holiday

is_holiday(self, dt: financepy.utils.date.Date)
Determines if a date is a Holiday according to the specified calendar. Weekends are not holidays unless the holiday falls on a weekend date.

holiday_weekend

holiday_weekend(self, dt: financepy.utils.date.Date)
Weekends by themselves are a holiday.

holiday_australia

holiday_australia(self, dt: financepy.utils.date.Date, day_in_year: int, weekday: int)
Only bank holidays. Weekends by themselves are not a holiday.

holiday_sydney

holiday_sydney(self, dt: financepy.utils.date.Date, day_in_year: int, weekday: int)
Sydney / NSW banking calendar. Weekends are handled separately by is_business_day(). Includes NSW public holidays relevant to Sydney banking, plus the NSW Bank Holiday on the first Monday in August.

holiday_australia_rits

holiday_australia_rits(self, dt: financepy.utils.date.Date, weekday: int)
RITS settlement calendar. RITS is open when banks are generally open in either Sydney or Melbourne. It is closed on weekends and on holidays observed in both NSW and Victoria. Weekends are handled separately by is_business_day().

holiday_aud_fx_settlement

holiday_aud_fx_settlement(self, dt: financepy.utils.date.Date, day_in_year: int, weekday: int)
AUD FX settlement calendar. An AUD FX value date must be a Sydney banking business day. Weekends are handled separately by is_business_day().

holiday_united_kingdom

holiday_united_kingdom(self, dt: financepy.utils.date.Date, day_in_year: int, weekday: int)
Only bank holidays. Weekends by themselves are not a holiday.

holiday_london

holiday_london(self, dt: financepy.utils.date.Date, day_in_year: int, weekday: int)
Only bank holidays. Weekends by themselves are not a holiday.

holiday_france

holiday_france(self, dt: financepy.utils.date.Date, day_in_year: int)
Only bank holidays. Weekends by themselves are not a holiday.

holiday_singapore

holiday_singapore(self, dt: financepy.utils.date.Date, weekday: int)
Singapore banking / public holiday calendar. Intended for: - SGD derivatives - Singapore banking business days - SGD settlement Weekends are handled separately by is_business_day(). Moving religious holidays are maintained from the official Singapore Ministry of Manpower annual holiday calendar.

holiday_sweden

holiday_sweden(self, dt: financepy.utils.date.Date, day_in_year: int, weekday: int)
Only bank holidays. Weekends by themselves are not a holiday.

holiday_germany

holiday_germany(self, dt: financepy.utils.date.Date, day_in_year: int)
Only bank holidays. Weekends by themselves are not a holiday.

holiday_switzerland

holiday_switzerland(self, dt: financepy.utils.date.Date, day_in_year: int)
Only bank holidays. Weekends by themselves are not a holiday.

holiday_zurich

holiday_zurich(self, dt: financepy.utils.date.Date, weekday: int)
Zurich / CHF currency holiday calendar. Intended for: - SARON - CHF OIS / swaps - CHF money-market settlement Weekends are handled separately by is_business_day().

holiday_japan

holiday_japan(self, dt: financepy.utils.date.Date, weekday: int)
Japanese statutory public holidays. Weekends handled separately.

holiday_tokyo

holiday_tokyo(self, dt: financepy.utils.date.Date, weekday: int)

No description available.

holiday_new_zealand

holiday_new_zealand(self, dt: financepy.utils.date.Date, day_in_year: int, weekday: int)
New Zealand public / banking holiday calendar. Weekends are handled separately by is_business_day(). Includes: - New Year's Day and day after New Year's Day - Waitangi Day - Good Friday - Easter Monday - ANZAC Day - King's / Queen's Birthday - Matariki - Labour Day - Christmas Day - Boxing Day Provincial anniversary days are deliberately excluded.

holiday_norway

holiday_norway(self, dt: financepy.utils.date.Date, day_in_year: int)
Only bank holidays. Weekends by themselves are not a holiday.

holiday_united_states

holiday_united_states(self, dt: financepy.utils.date.Date, weekday: int)
Only bank holidays. Weekends by themselves are not a holiday. This is a legacy generic US calendar that contains the superset of holidays for bond markets, NYSE, and public holidays. For each of these and other categories there will be some variations.

holiday_us_government_securities

holiday_us_government_securities(self, dt: financepy.utils.date.Date, weekday: int)
U.S. Government Securities / SIFMA calendar. Intended for: - U.S. Treasury / government securities market - SOFR-related business-day logic Weekends are handled separately by is_business_day(). NOTE: SIFMA recommendations can change and exceptional dates occur. Keep year-specific overrides for authoritative market closures.

holiday_us_federal_reserve

holiday_us_federal_reserve(self, dt: financepy.utils.date.Date, weekday: int)
Federal Reserve Bank business-day calendar. Intended for: - Federal Reserve Bank business days - Fedwire / National Settlement Service - EFFR / OBFR publication calendar Weekends are handled separately by is_business_day(). Important: - Saturday holidays are NOT observed on Friday by Federal Reserve Banks. - Sunday holidays ARE observed on Monday.

holiday_new_york

holiday_new_york(self, dt: financepy.utils.date.Date, weekday: int)
Only bank holidays. Weekends by themselves are not a holiday. This is a NY specific US calendar close to Federal Reserve calendar.

holiday_canada

holiday_canada(self, dt: financepy.utils.date.Date, day_in_year: int, weekday: int)
Only bank holidays. Weekends by themselves are not a holiday.

holiday_toronto

holiday_toronto(self, dt: financepy.utils.date.Date, weekday: int)
Toronto banking calendar. Intended for: - CORRA - CAD OIS / swaps - Toronto banking business-day conventions Weekends are handled separately by is_business_day().

holiday_italy

holiday_italy(self, dt: financepy.utils.date.Date, day_in_year: int)
Only bank holidays. Weekends by themselves are not a holiday.

holiday_hong_kong

holiday_hong_kong(self, dt: financepy.utils.date.Date, weekday: int)
Hong Kong banking / general holiday calendar. Intended for: - HKD derivatives - Hong Kong banking business days - HKD settlement Weekends are handled separately by is_business_day(). Lunar and substitution holidays should be maintained from the official gazetted Hong Kong holiday calendar.

holiday_target

holiday_target(self, dt: financepy.utils.date.Date, day_in_year)
Only bank holidays. Weekends by themselves are not a holiday.

holiday_none

holiday_none(self, dt: financepy.utils.date.Date = None)
No day is a holiday.

get_holiday_list

get_holiday_list(self, year: int)
Generate a list of declared calendar holidays in a given year. This includes declared holidays that fall on weekends, but does not include ordinary weekends unless the calendar type is WEEKEND.

easter_monday

easter_monday(self, year: float)
Get the day in a given year that is Easter Monday. This is not easy to compute, so we rely on a pre-calculated array.

CalendarTypes

CalendarTypes(*values)
Inherits from: Enum
Enum for calendar types.

DateGenRuleTypes

DateGenRuleTypes(*values)
Inherits from: Enum
Enum for date generation rule types.
Generated automatically from the FinancePy source code. Do not edit this file manually.