Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
include_epiphany = True
class SchleswigHolstein(Germany):
"Schleswig-Holstein"
class Thuringia(Germany):
"Thuringia"
FIXED_HOLIDAYS = Germany.FIXED_HOLIDAYS + (
(10, 31, "Reformation Day"),
)
class Portugal(WesternCalendar, ChristianMixin):
"Portugal"
include_good_friday = True
include_easter_sunday = True
FIXED_HOLIDAYS = WesternCalendar.FIXED_HOLIDAYS + (
(4, 25, "Dia da Liberdade"),
(5, 1, "Dia do Trabalhador"),
(6, 10, "Dia de Portugal"),
(8, 15, "Assunção de Nossa Senhora"),
(12, 8, "Imaculada Conceição"),
)
def get_variable_entrudo(self, year):
easter_sunday = self.get_easter_sunday(year)
return easter_sunday - timedelta(days=47)
whit_sunday_label = "Pentecost Sunday"
include_whit_monday = True
whit_monday_label = "Pentecost Monday"
include_boxing_day = True
boxing_day_label = "Second Day of Christmas"
include_all_saints = True
FIXED_HOLIDAYS = WesternCalendar.FIXED_HOLIDAYS + (
(3, 15, "National Day"),
(5, 1, "Labour Day"),
(8, 20, "St Stephen's Day"),
(10, 23, "National Day"),
)
class Iceland(WesternCalendar, ChristianMixin):
"Iceland"
include_holy_thursday = True
include_good_friday = True
include_easter_monday = True
include_ascension = True
include_whit_monday = True
include_christmas_eve = True
include_boxing_day = True
boxing_day_label = "St Stephen's Day"
FIXED_HOLIDAYS = WesternCalendar.FIXED_HOLIDAYS + (
(5, 1, "Labour Day"),
(6, 17, "Icelandic National Day"),
(12, 31, "New Year's Eve"),
)
days.append((date(year, 12, 24), "Christmas Eve"))
if self.include_boxing_day:
days.append((date(year, 12, 26), self.boxing_day_label))
if self.include_ascension:
days.append((
self.get_ascension_thursday(year), "Ascension Thursday"))
if self.include_whit_monday:
days.append((self.get_whit_monday(year), self.whit_monday_label))
if self.include_whit_sunday:
days.append((self.get_whit_sunday(year), self.whit_sunday_label))
if self.include_corpus_christi:
days.append((self.get_corpus_christi(year), "Corpus Christi"))
return days
class WesternMixin(ChristianMixin):
"""
General usage calendar for Western countries.
(chiefly Europe and Northern America)
"""
EASTER_METHOD = easter.EASTER_WESTERN
WEEKEND_DAYS = (SAT, SUN)
class OrthodoxMixin(ChristianMixin):
EASTER_METHOD = easter.EASTER_ORTHODOX
WEEKEND_DAYS = (SAT, SUN)
class LunarMixin:
FIXED_HOLIDAYS = WesternCalendar.FIXED_HOLIDAYS + (
(1, 1, "Restoration Day of the Independent Czech State"),
(5, 1, "Labour Day"),
(5, 8, "Liberation Day"),
(7, 5, "Saints Cyril and Methodius Day"),
(7, 6, "Jan Hus Day"),
(9, 28, "St. Wenceslas Day (Czech Statehood Day)"),
(10, 28, "Independent Czechoslovak State Day"),
(11, 17, "Struggle for Freedom and Democracy Day"),
(12, 24, "Christmas Eve"),
(12, 26, "St. Stephen's Day (The Second Christmas Day)"),
)
class Denmark(WesternCalendar, ChristianMixin):
"Denmark"
include_palm_sunday = True
include_holy_thursday = True
include_good_friday = True
include_easter_sunday = True
include_easter_monday = True
include_ascension = True
include_whit_sunday = True
whit_sunday_label = "Pentecost Sunday"
include_whit_monday = True
whit_monday_label = "Pentecost Monday"
include_boxing_day = True
boxing_day_label = "Second Day of Christmas"
include_christmas_eve = True
FIXED_HOLIDAYS = WesternCalendar.FIXED_HOLIDAYS + (
def get_variable_all_saints(self, year):
all_saints = date(year, 10, 31)
if all_saints.weekday() != SAT:
all_saints = Finland.get_nth_weekday_in_month(
year, 11, SAT)
return all_saints
def get_variable_days(self, year):
days = super(Finland, self).get_variable_days(year)
days.append((self.get_midsummer_eve(year), "Midsummer's Eve"))
days.append((self.get_midsummer_day(year), "Midsummer's Day"))
days.append((self.get_variable_all_saints(year), "All Saints"))
return days
class France(WesternCalendar, ChristianMixin):
"France"
include_easter_monday = True
include_ascension = True
include_whit_monday = True
include_all_saints = True
include_assumption = True
FIXED_HOLIDAYS = WesternCalendar.FIXED_HOLIDAYS + (
(5, 1, "Labour Day"),
(5, 8, "Victory in Europe Day"),
(7, 14, "Bastille Day"),
(11, 11, "Armistice Day"),
)
class Luxembourg(WesternCalendar, ChristianMixin):
if st_patrick.weekday() in self.get_weekend_days():
days.append((
self.find_following_working_day(st_patrick),
"Saint Patrick substitute"))
# Battle of boyne
battle_of_boyne = date(year, 7, 12)
days.append((battle_of_boyne, "Battle of the Boyne"))
if battle_of_boyne.weekday() in self.get_weekend_days():
days.append((
self.find_following_working_day(battle_of_boyne),
"Battle of the Boyne substitute"))
return days
class EuropeanCentralBank(WesternCalendar, ChristianMixin):
"European Central Bank"
FIXED_HOLIDAYS = WesternCalendar.FIXED_HOLIDAYS + (
(5, 1, "Labour Day"),
(12, 26, "St. Stephen's Day"),
)
include_good_friday = True
include_easter_monday = True
class Belgium(WesternCalendar, ChristianMixin):
"Belgium"
FIXED_HOLIDAYS = WesternCalendar.FIXED_HOLIDAYS + (
(5, 1, "Labour Day"),
(7, 21, "National Day"),
FIXED_HOLIDAYS = WesternCalendar.FIXED_HOLIDAYS + (
(4, 25, "Liberation Day"),
(5, 1, "International Workers' Day"),
(6, 2, "Republic Day"),
)
include_immaculate_conception = True
include_epiphany = True
include_easter_monday = True
include_assumption = True
include_all_saints = True
include_assumption = True
include_boxing_day = True
boxing_day_label = "St Stephen's Day"
class Norway(WesternCalendar, ChristianMixin):
"Norway"
include_holy_thursday = True
include_good_friday = True
include_easter_sunday = True
include_easter_monday = True
include_ascension = True
include_whit_monday = True
include_whit_sunday = True
include_boxing_day = True
boxing_day_label = "St Stephen's Day"
FIXED_HOLIDAYS = WesternCalendar.FIXED_HOLIDAYS + (
(5, 1, "Labour Day"),
(5, 17, "Constitution Day"),
)
(8, 15, "Assunção de Nossa Senhora"),
(12, 8, "Imaculada Conceição"),
)
def get_variable_entrudo(self, year):
easter_sunday = self.get_easter_sunday(year)
return easter_sunday - timedelta(days=47)
def get_variable_days(self, year):
days = super(Portugal, self).get_variable_days(year)
days.append((self.get_variable_entrudo(year), "Entrudo"))
return days
class Spain(WesternCalendar, ChristianMixin):
"Spain"
include_epiphany = True
include_immaculate_conception = True
include_good_friday = True
include_assumption = True
include_all_saints = True
FIXED_HOLIDAYS = WesternCalendar.FIXED_HOLIDAYS + (
(5, 1, u"Día del trabajador"),
(10, 12, u"Fiesta nacional de España"),
(12, 6, u"Día de la Constitución Española")
)
class Slovenia(WesternCalendar, ChristianMixin):
"Slovenia"
"France"
include_easter_monday = True
include_ascension = True
include_whit_monday = True
include_all_saints = True
include_assumption = True
FIXED_HOLIDAYS = WesternCalendar.FIXED_HOLIDAYS + (
(5, 1, "Labour Day"),
(5, 8, "Victory in Europe Day"),
(7, 14, "Bastille Day"),
(11, 11, "Armistice Day"),
)
class Luxembourg(WesternCalendar, ChristianMixin):
"Luxembourg"
include_easter_monday = True
include_ascension = True
include_whit_monday = True
include_all_saints = True
include_assumption = True
include_boxing_day = True
FIXED_HOLIDAYS = WesternCalendar.FIXED_HOLIDAYS + (
(5, 1, "Labour Day"),
(6, 23, "Luxembourg National Holiday"),
)
class Netherlands(WesternCalendar, ChristianMixin):
"Netherlands"
"Battle of the Boyne substitute"))
return days
class EuropeanCentralBank(WesternCalendar, ChristianMixin):
"European Central Bank"
FIXED_HOLIDAYS = WesternCalendar.FIXED_HOLIDAYS + (
(5, 1, "Labour Day"),
(12, 26, "St. Stephen's Day"),
)
include_good_friday = True
include_easter_monday = True
class Belgium(WesternCalendar, ChristianMixin):
"Belgium"
FIXED_HOLIDAYS = WesternCalendar.FIXED_HOLIDAYS + (
(5, 1, "Labour Day"),
(7, 21, "National Day"),
(11, 11, "Armistice of 1918"),
)
include_easter_monday = True
include_ascension = True
include_whit_monday = True
include_assumption = True
include_all_saints = True
class Germany(WesternCalendar, ChristianMixin):