HolidayCalendar

HolidayCalendar#

class sigtech.framework.infra.calendar.calendar.HolidayCalendar

Baseclasses: BaseCalendar

Subclasses: Calendar, ModifiedHolidayCalendar

Class representing holiday calendar objects as part of the instrument hierarchy within the framework.

Keyword arguments:

  • weekend - List of weekend days.

  • type - Indicate if the calendar is maintained by external provider or internal.

  • description: Calendar description.

Example of object creation:

from sigtech.framework.infra.calendar.calendar import HolidayCalendar
from sigtech.framework.infra.data_adapter.identifier import Identifier

calendar = HolidayCalendar(
               weekend=['saturday', 'sunday'],
               description='Test Calendar',
               identifier=Identifier.create('TESTCAL CALENDAR')
           )
property holidays: list

List of available holiday calendars.

first_holiday() date

First available holiday in the supported range, i.e. no data is available prior to this date.

modify_calendar(add_holidays: list[datetime.date] = None, remove_holidays: list[datetime.date] = None, new_name: str = None)

Add and/or remove certain dates from holidays list. If new_name is passed, a new calendar is created, otherwise the existing calendar is modified.

Parameters:
  • add_holidays – List of extra dates that should be holidays. If some days are already holidays, they are just ignored. (Optional, empty by default).

  • remove_holidays – List of dates that should not be holidays. If some days are missing from the original holidays, they are just ignored. (Optional, empty by default).

  • new_name – Name of the new calendar, if it should be created, rather than original calendar modified. (Optional, original calendar is modified by default). If only new_name is passed, and the other parameters are ignored, a copy of the existing calendar would be created