Skip to content

Latest commit

 

History

History
58 lines (32 loc) · 4.51 KB

File metadata and controls

58 lines (32 loc) · 4.51 KB
graph LR
    holidays___init___py["holidays.__init__.py"]
    holidays_registry_Registry["holidays.registry.Registry"]
    holidays_holiday_base_HolidayBase["holidays.holiday_base.HolidayBase"]
    holidays_observed_holiday_base_ObservedHolidayBase["holidays.observed_holiday_base.ObservedHolidayBase"]
    holidays___init___py -- "delegates to" --> holidays_registry_Registry
    holidays_registry_Registry -- "instantiates" --> holidays_holiday_base_HolidayBase
    holidays_observed_holiday_base_ObservedHolidayBase -- "inherits from" --> holidays_holiday_base_HolidayBase
Loading

CodeBoardingDemoContact

Details

The holidays subsystem provides a robust and extensible framework for managing holiday calendars across various countries and subdivisions. Its core functionality revolves around the Registry component, which acts as a central factory for instantiating specific holiday calendars. These calendars are built upon the HolidayBase abstract class, defining the fundamental structure and operations for holiday management. The ObservedHolidayBase extends this foundation by incorporating specialized logic for handling observed holidays, ensuring accurate date adjustments based on weekend rules and other observation practices. The __init__.py module serves as the public interface, simplifying user interaction with the underlying holiday data and logic.

holidays.init.py

This module serves as the primary public entry point for users interacting with the holidays library. It exposes the main holidays function or class, abstracting the underlying complexity of holiday retrieval and management. It acts as the public interface to the Registry, simplifying access to holiday data.

Related Classes/Methods:

holidays.registry.Registry

This is the central orchestrator of the subsystem. It is responsible for: Registration: Maintaining a collection of all available holiday definitions (e.g., country-specific holiday calendars). Instantiation (Factory): Creating instances of specific holiday calendars (e.g., HolidayBase or its subclasses) based on user requests (e.g., country code, year). Management: Providing a mechanism to retrieve and manage these holiday objects.

Related Classes/Methods:

holidays.holiday_base.HolidayBase

This abstract class provides the foundational structure and core functionalities for any holiday calendar. It defines the interface for adding holidays, managing holiday names, and potentially handling localization. It serves as the base contract for all concrete holiday implementations (e.g., country-specific holiday classes).

Related Classes/Methods:

holidays.observed_holiday_base.ObservedHolidayBase

This class extends HolidayBase to specifically encapsulate the logic for handling observed holidays. This includes rules for shifting holiday dates when they fall on non-working days (e.g., weekends), ensuring compliance with common observation practices.

Related Classes/Methods: