python-holidays icon indicating copy to clipboard operation
python-holidays copied to clipboard

Title: Add standardized holiday category tags (Public, Bank, Religious, Optional)

Open Shalini828 opened this issue 8 months ago • 2 comments

Currently, the library provides holiday data without a consistent and explicit categorization across all countries and regions. While some countries may implicitly differentiate types of holidays, there is no standardized structure to classify them.

Adding category tags to holidays would improve usability, especially for applications that need to filter or display holidays based on type.

Proposed Categories:

Public Holidays Bank Holidays Religious Holidays Optional/Observance Holidays

Proposed Solution:

Introduce a category attribute for each holiday entry Update country-specific modules to include category information Ensure backward compatibility (default category if not specified) Extend existing test cases to validate category assignment

Example:

holidays = { date(2026, 1, 26): {"name": "Republic Day", "category": "Public"}, date(2026, 3, 8): {"name": "Holi", "category": "Religious"} }

Expected Impact:

Enables filtering holidays by type Improves API usability for real-world applications Supports better UI/UX in apps using this library

Additional Context: This feature would be especially useful for countries like India, where different types of holidays (public, religious, optional) are widely used in calendars and institutions.

I would be happy to work on this feature and submit a PR if this approach is approved.

Shalini828 avatar Mar 30 '26 12:03 Shalini828

A similar idea was already suggested in #3357; take a look from https://github.com/vacanza/holidays/pull/3357#issuecomment-4104157654.

KJhellico avatar Mar 30 '26 12:03 KJhellico

Hi, I would like to work on this issue.

My plan:

  • Introduce a category field for each holiday (Public, Bank, Religious, Optional)
  • Ensure backward compatibility (default category if not specified)
  • Update a few country modules (starting with India)
  • Add tests to validate category assignment

Please let me know if this approach looks good 👍

omkarchougule10 avatar Mar 31 '26 11:03 omkarchougule10