Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Created IN.py #106

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all 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
96 changes: 96 additions & 0 deletions src/holidata/holidays/IN.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,96 @@
from dateutil.easter import EASTER_WESTERN
from .holidays import Country

#
# Information taken from various government websites and official sources around 2024-08-04
# https://www.india.gov.in/calendar
# https://www.officeholidays.com/countries/india/
# https://www.calendarlabs.com/holidays/india/
#
# This is a placeholder class for India holidays. More details will be added later.
Copy link
Member

Choose a reason for hiding this comment

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

So, this is currently just a draft? 🤔

#


class IN(Country):
id = "IN"
languages = ["hi", "en"]
regions = ["AN", "AP", "AR", "AS", "BR", "CH", "CT", "DD", "DL", "GA", "GJ", "HR", "HP", "JK", "JH", "KA", "KL", "LA", "LD", "MH", "ML", "MN", "MP", "MZ", "NL", "OR", "PB", "PY", "RJ", "SK", "TN", "TG", "TR", "UP", "UT", "WB"]
easter_type = EASTER_WESTERN

def __init__(self):
super().__init__()

self.define_holiday() \
.with_names({
"hi": "गणतंत्र दिवस",
"en": "Republic Day",
}) \
.on("01-26") \
.with_flags("NF")

self.define_holiday() \
.with_names({
"hi": "स्वतंत्रता दिवस",
"en": "Independence Day",
}) \
.on("08-15") \
.with_flags("NF")

self.define_holiday() \
.with_names({
"hi": "गांधी जयंती",
"en": "Gandhi Jayanti",
}) \
.on("10-02") \
.with_flags("NF")

self.define_holiday() \
.with_names({
"hi": "दीवाली",
"en": "Diwali",
}) \
.on("variable") \
.with_flags("NRF")

self.define_holiday() \
.with_names({
"hi": "होली",
"en": "Holi",
}) \
.on("variable") \
.with_flags("NRF")

self.define_holiday() \
.with_names({
"hi": "ईद उल-फितर",
"en": "Eid al-Fitr",
}) \
.on("variable") \
.with_flags("NRF")

self.define_holiday() \
.with_names({
"hi": "ईद उल-अधा",
"en": "Eid al-Adha",
}) \
.on("variable") \
.with_flags("NRF")

self.define_holiday() \
.with_names({
"hi": "क्रिसमस",
"en": "Christmas",
}) \
.on("12-25") \
.with_flags("NRF")

# Placeholder for additional holidays to be added later
Copy link
Member

Choose a reason for hiding this comment

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

If there are holidays left out, add a comment to the class, but not an actual holiday definition which will end up in the output.

self.define_holiday() \
.with_names({
"hi": "प्लेसहोल्डर",
"en": "Placeholder",
}) \
.on("02-17") \
.with_flags("NRF")

# More holidays and details will be added later as per the guidelines