{"id":6688,"library":"jpholiday","title":"Japan Public Holiday Generator","description":"jpholiday is a pure-Python library designed to easily retrieve Japan's national holidays based on data published by the Cabinet Office. It is currently at version 1.0.3 and maintains an active release cadence with several updates in recent months, continuously improving accuracy and functionality.","status":"active","version":"1.0.3","language":"en","source_language":"en","source_url":"https://github.com/Lalcs/jpholiday","tags":["holiday","japan","date","calendar","public holiday"],"install":[{"cmd":"pip install jpholiday","lang":"bash","label":"Install stable release"}],"dependencies":[],"imports":[{"symbol":"JPHoliday","correct":"from jpholiday import JPHoliday"}],"quickstart":{"code":"import datetime\nfrom jpholiday import JPHoliday\n\n# Initialize the JPHoliday instance\njpholiday_instance = JPHoliday()\n\n# Check if a specific date is a holiday\ndate_to_check = datetime.date(2024, 1, 1) # New Year's Day\nis_holiday = jpholiday_instance.is_holiday(date_to_check)\nprint(f\"Is {date_to_check} a holiday? {is_holiday}\")\n\n# Get the name(s) of holidays on a specific date\nholidays_on_date = jpholiday_instance.holidays(date_to_check)\nif holidays_on_date:\n    for holiday in holidays_on_date:\n        print(f\"Holiday on {holiday.date}: {holiday.name}\")\n\n# Get all holidays for a specific year\nyear_to_check = 2024\nyear_holidays = jpholiday_instance.year_holidays(year_to_check)\nprint(f\"\\nHolidays in {year_to_check} (first 3):\")\nfor holiday in year_holidays[:3]:\n    print(f\"  {holiday.date}: {holiday.name}\")","lang":"python","description":"This quickstart demonstrates how to check if a specific date is a holiday, retrieve holiday names for a given date, and list all holidays for a particular year using the JPHoliday class."},"warnings":[{"fix":"Review and rewrite custom holiday classes to align with the new `OriginalHoliday` interface introduced in v1.0.0 and later.","message":"The interface for defining custom holidays (`OriginalHoliday`) changed significantly in v1.0.0, causing incompatibility with previous versions. Custom holiday implementations require updates.","severity":"breaking","affected_versions":"<1.0.0"},{"fix":"Upgrade to v1.0.1 or newer to resolve import stability issues. Ensure your import statement is `from jpholiday import JPHoliday`.","message":"Versions prior to v1.0.1 had issues with correct imports, which could lead to `ImportError` or unexpected behavior.","severity":"gotcha","affected_versions":"<1.0.1"},{"fix":"Ensure your project uses Python 3.9 or newer, as specified in the `requires_python` metadata.","message":"Support for Python 3.5 was officially removed in version 0.1.6.","severity":"deprecated","affected_versions":"<0.1.6"},{"fix":"Be aware that holiday data for years past 2027 may be provisional and subject to change upon official government announcement. Use with caution for long-term planning.","message":"Accuracy for holidays beyond 2027 is not guaranteed. While the library can calculate them, official announcements from the Cabinet Office are only verified up to 2027.","severity":"gotcha","affected_versions":"All versions (for future dates)"},{"fix":"Upgrade to v0.1.5 or newer to ensure the most accurate historical holiday data is used, correcting previous discrepancies.","message":"Older versions (prior to v0.1.5) had discrepancies with Cabinet Office data for certain days between 1990 and 2021 (specifically, 4 days were incorrect).","severity":"gotcha","affected_versions":"<0.1.5"}],"env_vars":null,"last_verified":"2026-04-15T00:00:00.000Z","next_check":"2026-07-14T00:00:00.000Z","problems":[]}