Skip to content
Open
Show file tree
Hide file tree
Changes from 9 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
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -879,7 +879,7 @@ any) in brackets, available languages and additional holiday categories. All cou
<td>IN</td>
<td>States: AN (Andaman and Nicobar Islands), AP (Andhra Pradesh), AR (Arunachal Pradesh, Arunāchal Pradesh), AS (Assam), BR (Bihar, Bihār), CG (Chhattisgarh, Chhattīsgarh), CH (Chandigarh, Chandīgarh), DH (Dadra and Nagar Haveli and Daman and Diu, Dādra and Nagar Haveli and Damān and Diu), DL (Delhi), GA (Goa), GJ (Gujarat, Gujarāt), HP (Himachal Pradesh, Himāchal Pradesh), HR (Haryana, Haryāna), JH (Jharkhand, Jhārkhand), JK (Jammu and Kashmir, Jammu and Kashmīr), KA (Karnataka, Karnātaka), KL (Kerala), LA (Ladakh, Ladākh), LD (Lakshadweep), MH (Maharashtra, Mahārāshtra), ML (Meghalaya, Meghālaya), MN (Manipur), MP (Madhya Pradesh), MZ (Mizoram), NL (Nagaland, Nāgāland), OD (Odisha), PB (Punjab), PY (Puducherry), RJ (Rajasthan, Rājasthān), SK (Sikkim), TN (Tamil Nadu, Tamil Nādu), TR (Tripura), TS (TG, Telangana, Telangāna), UK (Uttarakhand, Uttarākhand), UP (Uttar Pradesh), WB (West Bengal)</td>
<td>bn, <strong>en_IN</strong>, en_US, gu, hi, kn, ml, mr, pa, ta, te</td>
<td>OPTIONAL</td>
<td>OPTIONAL, WOMEN_OPTIONAL</td>
</tr>
<tr>
<td>Indonesia</td>
Expand Down
181 changes: 181 additions & 0 deletions holidays/calendars/hindu.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,19 +21,22 @@
BASANT_PANCHAMI = "BASANT_PANCHAMI"
BONALU = "BONALU"
BUDDHA_PURNIMA = "BUDDHA_PURNIMA"
CHAITRA_NAVRATRI = "CHAITRA_NAVRATRI"
CHHATH_PUJA = "CHHATH_PUJA"
DIWALI = "DIWALI"
DIWALI_INDIA = "DIWALI_INDIA"
DUSSEHRA = "DUSSEHRA"
GANESH_CHATURTHI = "GANESH_CHATURTHI"
GOVARDHAN_PUJA = "GOVARDHAN_PUJA"
GUDI_PADWA = "GUDI_PADWA"
GURU_ARJUN_DEV_MARTYRDOM_DATES = "GURU_ARJUN_DEV_MARTYRDOM_DATES"
Comment thread
coderabbitai[bot] marked this conversation as resolved.
Outdated
Comment thread
cubic-dev-ai[bot] marked this conversation as resolved.
Outdated
GURU_GOBIND_SINGH_JAYANTI = "GURU_GOBIND_SINGH_JAYANTI"
GURU_NANAK_JAYANTI = "GURU_NANAK_JAYANTI"
GURU_RAVIDAS_JAYANTI = "GURU_RAVIDAS_JAYANTI"
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 +47,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 @@ -197,6 +201,45 @@ class _HinduLunisolar:
2035: (MAY, 22),
}

# http://web.archive.org/web/20260627112746/https://www.drikpanchang.com/navratri/chaitra-navratri-ghatasthapana.html
CHAITRA_NAVRATRI_DATES = {
2001: (MAR, 26),
2002: (APR, 13),
2003: (APR, 2),
2004: (MAR, 22),
2005: (APR, 9),
2006: (MAR, 30),
2007: (MAR, 20),
2008: (APR, 7),
2009: (MAR, 27),
2010: (MAR, 17),
2011: (APR, 4),
2012: (MAR, 23),
2013: (APR, 11),
2014: (MAR, 31),
2015: (MAR, 21),
2016: (APR, 8),
2017: (MAR, 29),
2018: (MAR, 18),
2019: (APR, 6),
2020: (MAR, 25),
2021: (APR, 13),
2022: (APR, 2),
2023: (MAR, 22),
2024: (APR, 9),
2025: (MAR, 30),
2026: (MAR, 20),
2027: (APR, 8),
2028: (MAR, 27),
2029: (APR, 15),
2030: (APR, 4),
2031: (MAR, 24),
2032: (APR, 11),
2033: (MAR, 31),
2034: (MAR, 21),
2035: (APR, 9),
}

# https://web.archive.org/web/20250404174934/https://www.timeanddate.com/holidays/india/chhat-puja
CHHATH_PUJA_DATES = {
2001: (NOV, 21),
Expand Down Expand Up @@ -634,6 +677,45 @@ class _HinduLunisolar:
2035: (APR, 9),
}

# https://web.archive.org/web/20260617120653/https://www.officeholidays.com/holidays/india/punjab/guru-arjun-dev-martyrdom-day
GURU_ARJUN_DEV_MARTYRDOM_DATES = {
2001: (MAY, 28),
2002: (JUN, 16),
2003: (JUN, 6),
2004: (MAY, 26),
2005: (JUN, 14),
2006: (JUN, 3),
2007: (MAY, 24),
2008: (JUN, 11),
2009: (MAY, 31),
2010: (MAY, 21),
2011: (JUN, 9),
2012: (MAY, 28),
2013: (JUN, 16),
2014: (JUN, 5),
2015: (MAY, 25),
2016: (JUN, 13),
2017: (JUN, 2),
2018: (JUN, 17),
2019: (JUN, 16),
2020: (MAY, 26),
2021: (JUN, 14),
2022: (JUN, 3),
2023: (MAY, 23),
2024: (JUN, 10),
2025: (MAY, 30),
2026: (JUN, 18),
2027: (JUN, 8),
2028: (MAY, 28),
2029: (JUN, 16),
2030: (JUN, 5),
2031: (MAY, 26),
2032: (JUN, 13),
2033: (JUN, 2),
2034: (MAY, 22),
2035: (JUN, 11),
}

# https://web.archive.org/web/20241231181629/https://www.timeanddate.com/holidays/india/guru-govind-singh-jayanti
GURU_GOBIND_SINGH_JAYANTI_DATES = {
2001: (JAN, 2),
Expand Down Expand Up @@ -857,6 +939,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 +1104,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 +1376,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 @@ -1843,6 +2012,9 @@ def bonalu_date(self, year: int) -> tuple[date | None, bool]:
def buddha_purnima_date(self, year: int) -> tuple[date | None, bool]:
return self._get_holiday(BUDDHA_PURNIMA, year)

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

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

Expand All @@ -1864,6 +2036,9 @@ def govardhan_puja_date(self, year: int) -> tuple[date | None, bool]:
def gudi_padwa_date(self, year: int) -> tuple[date | None, bool]:
return self._get_holiday(GUDI_PADWA, year)

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

def guru_gobind_singh_jayanti_date(self, year: int) -> Iterable[tuple[date, bool]]:
return self._get_holiday_set(GURU_GOBIND_SINGH_JAYANTI, year)

Expand All @@ -1885,6 +2060,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 +2090,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
Loading