Skip to main content

luna.financial.holiday_checker

RollDayConvention Objects

@enum.unique
class RollDayConvention(str, enum.Enum)

Enumeration for specifying day rolling conventions.

get_holiday_calendar_by_id

def get_holiday_calendar_by_id(calendar_id: int) -> dict

Retrieves holiday calendar data based on a given calendar ID.

HolidayCalendar Objects

class HolidayCalendar()

Manages business days and public holidays, using a provided holiday calendar.

is_weekend_day

def is_weekend_day(run_date: date) -> bool

Determines if the given date is a weekend.

is_public_holiday

def is_public_holiday(run_date: date) -> bool

Checks if the given date is a public holiday.

is_holiday_day

def is_holiday_day(run_date: date) -> bool

Determines if the given date is a holiday (weekend or public holiday).

get_weekends_and_business_days

def get_weekends_and_business_days() -> dict

Retrieves a mapping of days of the week to their weekend or business day status.

get_nearest_previous_business_day

def get_nearest_previous_business_day(run_date: date) -> date

Finds the nearest previous business day to the given date.

get_nearest_next_business_day

def get_nearest_next_business_day(run_date: date) -> date

Finds the nearest next business day to the given date.