Skip to content
Open
Show file tree
Hide file tree
Changes from 7 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
95 changes: 95 additions & 0 deletions holidays/calendars/hindu.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
GYALPO_LOSAR = "GYALPO_LOSAR"
HOLI = "HOLI"
JANMASHTAMI = "JANMASHTAMI"
KABIR_JAYANTI = "KABIR_JAYANTI"
KARWA_CHAUTH = "KARWA_CHAUTH"
MAHA_ASHTAMI = "MAHA_ASHTAMI"
MAHA_NAVAMI = "MAHA_NAVAMI"
Expand All @@ -44,6 +45,7 @@
MAKAR_SANKRANTI = "MAKAR_SANKRANTI"
NARAKA_CHATURDASHI = "NARAKA_CHATURDASHI"
ONAM = "ONAM"
PARSHURAM_JAYANTI = "PARSHURAM_JAYANTI"
PONGAL = "PONGAL"
RAKSHA_BANDHAN = "RAKSHA_BANDHAN"
RAM_NAVAMI = "RAM_NAVAMI"
Expand Down Expand Up @@ -857,6 +859,45 @@ class _HinduLunisolar:
2035: (AUG, 26),
}

# https://web.archive.org/web/20250612160056/https://www.drikpanchang.com/hindu-saints/kabirdas/sant-kabir-jayanti.html
KABIR_JAYANTI_DATES = {
2001: (JUN, 6),
2002: (JUN, 24),
2003: (JUN, 14),
2004: (JUN, 3),
2005: (JUN, 22),
2006: (JUN, 11),
2007: (JUN, 30),
2008: (JUN, 18),
2009: (JUN, 7),
2010: (JUN, 26),
2011: (JUN, 15),
2012: (JUN, 4),
2013: (JUN, 23),
2014: (JUN, 13),
2015: (JUN, 2),
2016: (JUN, 20),
2017: (JUN, 9),
2018: (JUN, 28),
2019: (JUN, 17),
2020: (JUN, 5),
2021: (JUN, 24),
2022: (JUN, 14),
2023: (JUN, 4),
2024: (JUN, 22),
2025: (JUN, 11),
2026: (JUN, 29),
2027: (JUN, 18),
2028: (JUN, 7),
2029: (JUN, 26),
2030: (JUN, 15),
2031: (JUN, 5),
2032: (JUN, 23),
2033: (JUN, 12),
2034: (JUN, 2),
2035: (JUN, 20),
}

# https://web.archive.org/web/20260123230237/https://www.timeanddate.com/holidays/india/karaka-chaturthi
KARWA_CHAUTH_DATES = {
2001: (NOV, 4),
Expand Down Expand Up @@ -983,6 +1024,15 @@ class _HinduLunisolar:
# [2022](https://web.archive.org/web/20251213151608/https://gad.rajasthan.gov.in/writereaddata/OLDWEBDATA/PDF/Govt_holidays_list_21_10_2021.pdf)
# [2023](https://web.archive.org/web/20251213151559/https://gad.rajasthan.gov.in/writereaddata/OLDWEBDATA/PDF/Govt_holidays_list_16_11_2022.pdf)
MAHARANA_PRATAP_JAYANTI_DATES = {
2001: (MAY, 25),
2002: (JUN, 13),
2003: (JUN, 3),
2004: (MAY, 22),
2005: (JUN, 10),
2006: (MAY, 30),
2007: (JUN, 17),
2008: (JUN, 6),
2009: (MAY, 27),
2010: (JUN, 15),
2011: (JUN, 4),
2012: (MAY, 24),
Expand Down Expand Up @@ -1246,6 +1296,45 @@ class _HinduLunisolar:
2035: (SEP, 14),
}

# http://web.archive.org/web/20260312200240/https://www.drikpanchang.com/dashavatara/parashurama/parashurama-jayanti-date-time.html
PARSHURAM_JAYANTI_DATES = {
2001: (APR, 25),
2002: (MAY, 14),
2003: (MAY, 4),
2004: (APR, 22),
2005: (MAY, 10),
2006: (APR, 30),
2007: (APR, 19),
2008: (MAY, 7),
2009: (APR, 27),
2010: (MAY, 16),
2011: (MAY, 5),
2012: (APR, 24),
2013: (MAY, 12),
2014: (MAY, 1),
2015: (APR, 20),
2016: (MAY, 8),
2017: (APR, 28),
2018: (APR, 18),
2019: (MAY, 7),
2020: (APR, 25),
2021: (MAY, 14),
2022: (MAY, 3),
2023: (APR, 22),
2024: (MAY, 10),
2025: (APR, 29),
2026: (APR, 19),
2027: (MAY, 8),
2028: (APR, 27),
2029: (MAY, 16),
2030: (MAY, 5),
2031: (APR, 24),
2032: (MAY, 11),
2033: (MAY, 1),
2034: (APR, 20),
2035: (MAY, 9),
}

PONGAL_DATES = {
2001: (JAN, 14),
2002: (JAN, 14),
Expand Down Expand Up @@ -1885,6 +1974,9 @@ def janmashtami_date(self, year: int) -> tuple[date | None, bool]:
def karwa_chauth_date(self, year: int) -> tuple[date | None, bool]:
return self._get_holiday(KARWA_CHAUTH, year)

def kabir_jayanti_date(self, year: int) -> tuple[date | None, bool]:
return self._get_holiday(KABIR_JAYANTI, year)

Comment on lines +2313 to +2315

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

Accessor out of alphabetical order.

kabir_jayanti_date is placed after karwa_chauth_date, but the KABIR_JAYANTI_DATES dict itself is correctly ordered before KARWA_CHAUTH_DATES alphabetically. Every other accessor method in this class mirrors its DATES-dict ordering — this one breaks that pattern.

♻️ Suggested fix
+    def kabir_jayanti_date(self, year: int) -> tuple[date | None, bool]:
+        return self._get_holiday(KABIR_JAYANTI, year)
+
     def karwa_chauth_date(self, year: int) -> tuple[date | None, bool]:
         return self._get_holiday(KARWA_CHAUTH, year)

-    def kabir_jayanti_date(self, year: int) -> tuple[date | None, bool]:
-        return self._get_holiday(KABIR_JAYANTI, year)
-
     def maha_ashtami_date(self, year: int) -> tuple[date | None, bool]:
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@holidays/calendars/hindu.py` around lines 1977 - 1979, The kabir_jayanti_date
accessor is out of alphabetical order relative to the other holiday accessors in
hindu.py. Move kabir_jayanti_date so it appears before karwa_chauth_date,
keeping the accessor method order aligned with the KABIR_JAYANTI_DATES and
KARWA_CHAUTH_DATES dictionary order and matching the existing pattern used by
the class.

def maha_ashtami_date(self, year: int) -> tuple[date | None, bool]:
return self._get_holiday(MAHA_ASHTAMI, year)

Expand Down Expand Up @@ -1912,6 +2004,9 @@ def naraka_chaturdashi_date(self, year: int) -> tuple[date | None, bool]:
def onam_date(self, year: int) -> tuple[date | None, bool]:
return self._get_holiday(ONAM, year)

def parshuram_jayanti_date(self, year: int) -> tuple[date | None, bool]:
return self._get_holiday(PARSHURAM_JAYANTI, year)

def pongal_date(self, year: int) -> tuple[date | None, bool]:
return self._get_holiday(PONGAL, year)

Expand Down
1 change: 1 addition & 0 deletions holidays/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@
PUBLIC = "public"
SCHOOL = "school"
UNOFFICIAL = "unofficial"
WOMEN_OPTIONAL = "women_optional"
WORKDAY = "workday"

CATHOLIC = "catholic"
Expand Down
69 changes: 67 additions & 2 deletions holidays/countries/india.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@

from holidays.calendars import _CustomIslamicHolidays
from holidays.calendars.gregorian import JAN, FEB, MAR, APR, MAY, JUN, JUL, AUG, SEP, OCT, NOV, DEC
from holidays.constants import OPTIONAL, PUBLIC
from holidays.constants import OPTIONAL, PUBLIC, WOMEN_OPTIONAL
from holidays.groups import (
ChristianHolidays,
HinduCalendarHolidays,
Expand Down Expand Up @@ -54,6 +54,8 @@ class India(
* <https://web.archive.org/web/20251214133200/https://andamannicobar.gov.in/admin-pannel/othersdoc/1-29-Holiday%20List%202026%20Gazette.pdf>
* Gujarat:
* <https://web.archive.org/web/20260122052040/https://images-gujarati.indianexpress.com/2025/11/gujarat-government-Year-2026-holiday-list.pdf>
* Himachal Pradesh:
* <http://web.archive.org/web/20260627103337/https://www.comply360.in/labor-law-library/wp-content/uploads/2025/12/Notification-regarding-list-of-Holidays-for-the-Year-2026-in-Himachal-Pradesh-1.pdf>
* Kerala:
* <https://web.archive.org/web/20260329164551/https://kerala.gov.in/showcalendar/2026>
* Maharashtra:
Expand Down Expand Up @@ -170,7 +172,7 @@ class India(
"Uttar Pradesh": "UP",
"West Bengal": "WB",
}
supported_categories = (OPTIONAL, PUBLIC)
supported_categories = (OPTIONAL, PUBLIC, WOMEN_OPTIONAL)
supported_languages = ("bn", "en_IN", "en_US", "gu", "hi", "kn", "ml", "mr", "pa", "ta", "te")
_deprecated_subdivisions = (
"DD", # Daman and Diu.
Expand Down Expand Up @@ -527,8 +529,30 @@ def _populate_subdiv_hr_public_holidays(self):

# Himachal Pradesh.
def _populate_subdiv_hp_public_holidays(self):
# Statehood Day.
self._add_holiday_jan_25(tr("Statehood Day"))
# Guru Ravidas's Jayanti.
self._add_guru_ravidas_jayanti(tr("Guru Ravidas's Jayanti"))
# Himachal Day.
self._add_holiday_apr_15(tr("Himachal Day"))
# Bhagvan Shree Parshuram Jayanti
self._add_parshuram_jayanti(tr("Bhagvan Shree Parshuram Jayanti"))
# Maharana Pratap Jayanti.
self._add_maharana_pratap_jayanti(tr("Maharana Pratap Jayanti"))
# Sant Guru Kabir Jayanti (Prakat Diwas).
self._add_kabir_jayanti(tr("Sant Guru Kabir Jayanti (Prakat Diwas)"))
# Dussehra.
self._add_dussehra(tr("Dussehra"))
# Maharishi Valmiki's Birthday.
self._add_maharishi_valmiki_jayanti(tr("Maharishi Valmiki's Birthday"))

def _populate_subdiv_hp_women_optional_holidays(self):
Comment thread
ankushhKapoor marked this conversation as resolved.
Comment thread
ankushhKapoor marked this conversation as resolved.
Comment thread
ankushhKapoor marked this conversation as resolved.
# Raksha Bandhan.
self._add_raksha_bandhan(tr("Raksha Bandhan"))
# Karwa Chouth.
self._add_karwa_chauth(tr("Karwa Chouth"))
# Bhai Duj.
self._add_bhai_dooj(tr("Bhai Duj"))
Comment thread
coderabbitai[bot] marked this conversation as resolved.

# Jammu and Kashmir
def _populate_subdiv_jk_public_holidays(self):
Expand Down Expand Up @@ -614,10 +638,43 @@ def _populate_subdiv_py_public_holidays(self):
def _populate_subdiv_pb_public_holidays(self):
# Guru Gobind Singh Jayanti.
self._add_guru_gobind_singh_jayanti(tr("Guru Gobind Singh Jayanti"))
# Shaheedi Diwas of Shaheed-eAzam Bhagat Singh, Sukhdev and Rajguru Ji.
self._add_holiday_mar_23(
tr("Shaheedi Diwas of Shaheed-e-Azam Bhagat Singh, Sukhdev and Rajguru Ji")
)
Comment thread
coderabbitai[bot] marked this conversation as resolved.
Outdated
# Birthday of Sri Guru Nabha Dass Ji.
self._add_holiday_apr_8(tr("Birthday of Sri Guru Nabha Dass Ji"))
# Vaisakhi.
self._add_vaisakhi(tr("Vaisakhi"))
# Birthday of Lord Parshuram Ji.
self._add_parshuram_jayanti(tr("Birthday of Lord Parshuram Ji"))
# Kabir Jayanti.
self._add_kabir_jayanti(tr("Kabir Jayanti"))
# Martyrdom Day of Shaheed Udham Singh.
self._add_holiday_jul_31(tr("Martyrdom Day of Shaheed Udham Singh"))
# Birthday of Maharishi Valmiki Ji.
self._add_maharishi_valmiki_jayanti(tr("Birthday of Maharishi Valmiki Ji"))
# Martyrdom Day of S. Kartar Singh Sarabha Ji.
self._add_holiday_nov_16(tr("Martyrdom Day of S. Kartar Singh Sarabha Ji"))
if self._year >= 2004:
# Martyrdom Day of Sri Guru Teg Bahadur Ji.
self._add_holiday_nov_24(tr("Martyrdom Day of Sri Guru Teg Bahadur Ji"))

def _populate_subdiv_pb_optional_holidays(self):
# Lohri.
self._add_lohri(tr("Lohri"))
# Birthday of Satguru Ram Singh Ji.
self._add_basant_panchami(tr("Birthday of Satguru Ram Singh Ji"))
# International Women Day.
self._add_womens_day(tr("International Women's Day"))
Comment thread
coderabbitai[bot] marked this conversation as resolved.
Outdated
# Death Anniversary of Maharaja Ranjit Singh Ji.
self._add_holiday_jun_27(tr("Death Anniversary of Maharaja Ranjit Singh Ji"))
# Saragarhi Day.
self._add_holiday_sep_12(tr("Saragarhi Day"))
# Birthday of S. Bhagat Singh Ji.
self._add_holiday_sep_28(tr("Birthday of S. Bhagat Singh Ji"))
# Birthday of Baba Banda Singh Ji Bahadur.
self._add_holiday_oct_16(tr("Birthday of Baba Banda Singh Ji Bahadur"))
# New Punjab Day.
self._add_holiday_nov_1(tr("New Punjab Day"))

Expand Down Expand Up @@ -743,6 +800,9 @@ class IndiaStaticHolidays:
# Guru Tegh Bahadur's Martyrdom Day.
name_guru_tegh_bahadur_martyrdom_day = tr("Guru Tegh Bahadur's Martyrdom Day")

# Martyrdom Day of Sri Guru Teg Bahadur Ji.
name_pb_guru_tegh_bahadur_martyrdom_day = tr("Martyrdom Day of Sri Guru Teg Bahadur Ji")

# Magh Bihu.
name_magh_bihu = tr("Magh Bihu")

Expand Down Expand Up @@ -782,3 +842,8 @@ class IndiaStaticHolidays:
),
2025: (AUG, 15, name_janmashtami_smarta),
}

special_pb_public_holidays = {
2002: (DEC, 8, name_pb_guru_tegh_bahadur_martyrdom_day),
2003: (NOV, 28, name_pb_guru_tegh_bahadur_martyrdom_day),
}
30 changes: 30 additions & 0 deletions holidays/groups/hindu.py
Original file line number Diff line number Diff line change
Expand Up @@ -333,6 +333,21 @@ def _add_janmashtami(self, name) -> date | None:
name, self._hindu_calendar.janmashtami_date(self._year)
)

def _add_kabir_jayanti(self, name) -> date | None:
"""
Add Kabir Jayanti.

Kabir Jayanti commemorates the birth anniversary of Saint Kabir,
the 15th-century Indian mystic poet and saint. It is observed on
the full moon day (Purnima) of the Hindu month of Jyeshtha
(May/June).

https://en.wikipedia.org/wiki/Kabir
"""
return self._add_hindu_calendar_holiday(
name, self._hindu_calendar.kabir_jayanti_date(self._year)
)

def _add_karwa_chauth(self, name) -> date | None:
"""
Add Karwa Chauth.
Expand Down Expand Up @@ -508,6 +523,21 @@ def _add_papankusha_duwadashi(self, name) -> date | None:
name, self._hindu_calendar.dussehra_date(self._year), days_delta=+2
)

def _add_parshuram_jayanti(self, name) -> date | None:
"""
Add Parshuram Jayanti.

Parshuram Jayanti commemorates the birth of Lord Parashurama,
the sixth avatar of Lord Vishnu. It is observed on the third
day (Tritiya) of the bright fortnight of the Hindu month of
Vaisakha (April/May).

https://en.wikipedia.org/wiki/Parashurama
"""
return self._add_hindu_calendar_holiday(
name, self._hindu_calendar.parshuram_jayanti_date(self._year)
)

def _add_pongal(self, name) -> date | None:
"""
Add Pongal.
Expand Down
Loading
Loading