Requirements
- Target platform
- OpenClaw
- Install method
- Manual import
- Extraction
- Extract archive
- Prerequisites
- OpenClaw
- Primary doc
- SKILL.md
Use this skill whenever a task involves checking, generating, or working with public holidays — for any country or subdivision (state, province, region). Tri...
Use this skill whenever a task involves checking, generating, or working with public holidays — for any country or subdivision (state, province, region). Tri...
Hand the extracted package to your coding agent with a concrete install brief instead of figuring it out manually.
I downloaded a skill package from Yavira. Read SKILL.md from the extracted folder and install it by following the included instructions. Tell me what you changed and call out any manual steps you could not complete.
I downloaded an updated skill package from Yavira. Read SKILL.md from the extracted folder, compare it with my current installation, and upgrade it while preserving any custom configuration unless the package docs explicitly say otherwise. Summarize what changed and any follow-up checks I should run.
holidays is a Python library that generates country- and subdivision-specific sets of government-designated holidays on the fly. It covers 249 countries (ISO 3166-1) and supports subdivisions (states, provinces, regions) via ISO 3166-2 codes. The central object is HolidayBase, which behaves like a Python dict mapping date → holiday name. All examples below can be run directly in the shell: python <<'EOF' # your code here EOF # OR (if the package is installed via uv) uv run - <<EOF # your code here EOF
IMPORTANT: Always use a virtual environment or --break-system-packages flag. pip install holidays --break-system-packages For production use, pin to a specific version: pip install holidays==0.58 --break-system-packages
TaskMethodAll holidays for a country/yearcountry_holidays('US', years=2024)Holidays for a subdivisioncountry_holidays('US', subdiv='CA', years=2024)Holidays in a date rangeholidays_obj['2024-01-01':'2024-01-31']Check if a date is a holidayholidays_obj.get('2024-12-25') → name or NoneAdd custom holidaysholidays_obj.update({'2024-07-10': 'My Birthday!'})List all supported countrieslist_supported_countries()List countries with localizationlist_localized_countries()
country_holidays( country, # ISO 3166-1 alpha-2 code, e.g. 'US', 'GB', 'DE' subdiv=None, # ISO 3166-2 subdivision code, e.g. 'CA', 'TX', 'BY' years=None, # int or list of ints, e.g. 2024 or [2023, 2024] expand=True, # auto-expand years when checking dates outside current range observed=True, # include observed holidays (e.g. holiday on weekend → Monday) language=None, # ISO 639-1 language code for holiday names, e.g. 'en', 'de' categories=None, # filter to specific holiday categories (country-dependent) ) Returns a HolidayBase object (dict-like: {date: name}).
from holidays import country_holidays us_holidays = country_holidays('US', years=2024) for date, name in sorted(us_holidays.items()): print(date, name)
Use the ISO 3166-2 subdivision code (e.g. 'CA' for California, 'BY' for Bavaria). from holidays import country_holidays ca_holidays = country_holidays('US', subdiv='CA', years=2024) for date, name in sorted(ca_holidays.items()): print(date, name)
Slice the HolidayBase object with date strings ('YYYY-MM-DD'): from holidays import country_holidays ca_holidays = country_holidays('US', subdiv='CA', years=2024) for day in ca_holidays['2024-01-01':'2024-01-31']: print(f"{day}: {ca_holidays.get(day)}")
.get() returns the holiday name if the date is a holiday, or None if it is not. from holidays import country_holidays ca_holidays = country_holidays('US', subdiv='CA') # Is December 25 a holiday? name = ca_holidays.get('2024-12-25') print(name) # → 'Christmas Day' # Is December 26 a holiday? name = ca_holidays.get('2024-12-26') print(name) # → None Tip: Use if date in holidays_obj: for a boolean check (faster than .get()).
SECURITY NOTE: Only use custom holidays if the user explicitly provides or requests them. Never assume a file location exists. ALWAYS ask the user for the file path rather than using a default location. If they don't have a custom holidays file, skip this feature. Example workflow: Ask user: "Do you have a custom holidays JSON file you'd like to include?" If yes, ask: "What's the full path to your custom holidays file?" Only then load and merge: import json from pathlib import Path from holidays import country_holidays # ONLY use this if user explicitly provided the path custom_file = Path("/path/user/provided/custom-holidays.json") # Verify file exists before reading if custom_file.exists(): with open(custom_file) as f: custom_data = json.load(f) holidays_2024 = country_holidays('US', years=2024) holidays_2024.update(custom_data) print(holidays_2024.get('2024-07-10')) # → 'My Birthday!' (if defined) else: print(f"File not found: {custom_file}") Custom holidays file format: { "2024-07-10": "My Birthday!", "2024-10-01": "Family Celebration" }
from holidays import list_supported_countries # include_aliases=True also returns common aliases (e.g. 'UK' for 'GB') supported = list_supported_countries(include_aliases=True) print(supported['US']) # → list of supported US subdivision codes
Language codes: Use ISO 639-1 codes (e.g., en, de, fr) Some countries use locale-specific codes (e.g., en_US, zh_CN) If an unsupported language is requested, the library falls back to the default language Step 1: Find countries with localization support from holidays import list_localized_countries # Get all countries that support multiple languages localized = list_localized_countries(include_aliases=True) # Check if a specific country supports localization if 'MY' in localized: print(f"Malaysia supports: {localized['MY']}") # Output: Malaysia supports: ['en_MY', 'ms_MY', 'zh_CN', ...] Step 2: Generate holidays in a specific language from holidays import country_holidays # Malaysia holidays in Malay language my_holidays_ms = country_holidays('MY', years=2025, language='ms_MY') for date, name in sorted(my_holidays_ms.items())[:3]: print(f"{date}: {name}") # Same holidays in English my_holidays_en = country_holidays('MY', years=2025, language='en_MY') for date, name in sorted(my_holidays_en.items())[:3]: print(f"{date}: {name}")
observed=True (default): When a holiday falls on a weekend, the observed date (typically Monday) is included. Set observed=False to get only the statutory date. expand=True (default): If you check a date outside the years range, the library automatically adds that year. Set expand=False to prevent this. Multiple years: Pass a list to years to load several years at once: years=[2023, 2024, 2025]. Date keys: The HolidayBase dict accepts datetime.date, datetime.datetime, or 'YYYY-MM-DD' strings interchangeably as keys. Country codes: Use ISO 3166-1 alpha-2 (e.g. 'US', 'GB', 'DE'). Aliases like 'UK' are supported when include_aliases=True.
Python: 3.10+ Package: holidays (PyPI). Install with: pip install holidays --break-system-packages No external system dependencies required
Package installation: Use --break-system-packages flag (required in this environment) and consider pinning to a specific version Custom holidays files: Only load custom holidays when explicitly requested by the user with a user-provided path File access: Verify file existence before reading to avoid exposing directory structure
Data access, storage, extraction, analysis, reporting, and insight generation.
Largest current source with strong distribution and engagement signals.