Skip to content

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

DaysCount(
    start_date: date = None,
    end_date: date = None,
    count: int = None,
    freq: CalFreq = None,
)

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:

  • key (str) –

    A Unique key to identify the span. Takes the form of {year}-{span}{span-number}.

key property

key: str

A Unique key to identify the span. Takes the form of {year}-{span}{span-number}.

i.e: "2025-Q3", 2025-S1, 2025-M8

NextDate dataclass

NextDate(date: date, next_date: date)

Holds the requested date and the next_date

PreviousDate dataclass

PreviousDate(date: date, previous_date: date)

Holds the requested date and the previous_date

ApiHealth dataclass

ApiHealth(
    api_status: str = None, appname: str = APPLICATION_NAME
)

Chack the status of the API. It doesn't need an APIKEY