Source code for aeat.core.resources._repos.holiday_calendars
"""Year-keyed holiday-calendar repository.
:class:`HolidayCalendarRepository` loads BOE holiday calendars through the
shared :class:`ResourceCacheRepository` cache behind :class:`ResourceRegistry`.
"""
from __future__ import annotations
from typing import override
from .._repository import ResourceCacheRepository
[docs]
class HolidayCalendarRepository(ResourceCacheRepository[object, int]):
"""Year-keyed repository for BOE holiday calendars.
Wraps :func:`aeat.domain.deadlines.load_holiday_calendar`
behind the shared :class:`ResourceCacheRepository` cache.
"""
@override
def _load(self, key: int) -> object:
from ....domain.deadlines import load_holiday_calendar
return load_holiday_calendar(key)