Response models¶
Holiday
dataclass
¶
Holiday(description: str = None, day: int = None, month: int = None, date: date = None, holiday_type: CalHolidayType = None, status: CalHolidayStatus = None, country_code: str = 'MA')
Represents a Holiday
HolidayCheckResult
dataclass
¶
HolidayCheckResult(date: date = None, is_holiday: bool = None, description: str = None, holiday_type: CalHolidayType = None, status: CalHolidayStatus = None, country_code: str = 'MA')
The result of is-holiday check. If the date is a Holiday, holds also its description, type and status
DaysCount
dataclass
¶
Counts the number of business days between 2 dates.
start_date and end_date are open business days
CalSpan
dataclass
¶
CalSpan(start_date: date = None, end_date: date = None, year: int = None, semester: int = None, quarter: int = None, month: int = None, country_code: str = 'MA')
Represents the span of a period delimited by the interval start/end date (open day inclusive)
i.e: 2026-S1 = CalSpan(year=2026, semester=1, start_date=2026-01-02, end_date=2026-06-30)
Attributes:
NextDate
dataclass
¶
Holds the requested date and the next_date
PreviousDate
dataclass
¶
Holds the requested date and the previous_date
ApiHealth
dataclass
¶
Chack the status of the API. It doesn't need an APIKEY
Tagged Calendar¶
TaggedYear
dataclass
¶
TaggedYear(year: int = None, counts: TaggedDaysCount = None, months: list[TaggedMonth] = list())
A full year of the Tagged Calendar, month by month
Methods:
-
month–Get a month of the year
Attributes:
month
¶
month(month: int) -> TaggedMonth
Get a month of the year
Parameters:
Raises:
-
KeyError–Month not in the year
Source code in pycalendar_api/models/tagged.py
120 121 122 123 124 125 126 127 128 129 130 131 132 | |
TaggedMonth
dataclass
¶
TaggedMonth(year: int = None, month: int = None, label: str = None, weekday_labels: list[str] = list(), counts: TaggedDaysCount = None, weeks: list[list[TaggedDay | None]] = list())
A month of the Tagged Calendar laid out in ISO weeks (Monday → Sunday), ready to be rendered as a calendar grid.
weeks is a list of 7 days lists, the days outside the month are None. weekday_labels are the column headers (MO → SU).
Attributes:
TaggedDay
dataclass
¶
TaggedDay(date: date = None, day_kind: DayKind = None, is_business_day: bool = None, is_weekend: bool = None, is_holiday: bool = None, holiday_type: CalHolidayType = None, status: CalHolidayStatus = None, description: str = None, label: str = None, country_code: str = 'MA')
A day of the Tagged Calendar, tagged with its day_kind.
holiday_type, status and description are only defined when is_holiday is True.
A holiday falling on a weekend has is_holiday=True and day_kind=DayKind.WEEKEND.