-
Notifications
You must be signed in to change notification settings - Fork 481
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2 from dr-prodigy/beta
Update beta
- Loading branch information
Showing
13 changed files
with
226 additions
and
63 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
# -*- coding: utf-8 -*- | ||
|
||
# python-holidays | ||
# --------------- | ||
# A fast, efficient Python library for generating country, province and state | ||
# specific sets of holidays on the fly. It aims to make determining whether a | ||
# specific date is a holiday as fast and flexible as possible. | ||
# | ||
# Author: tasnim<[email protected]> | ||
# ISO code = BD | ||
|
||
from datetime import date | ||
from holidays.constants import FEB, MAR, APR, MAY, AUG, DEC | ||
from holidays.holiday_base import HolidayBase | ||
|
||
|
||
class Bangladesh(HolidayBase): | ||
# https://mopa.gov.bd/sites/default/files/files/mopa.gov.bd/public_holiday/61c35b73_e335_462a_9bcf_4695b23b6d82/reg4-2019-212.PDF | ||
# https://en.wikipedia.org/wiki/Public_holidays_in_Bangladesh | ||
|
||
def __init__(self, **kwargs): | ||
self.country = 'TR' | ||
HolidayBase.__init__(self, **kwargs) | ||
|
||
def _populate(self, year): | ||
|
||
# 21st Feb | ||
self[date(year, FEB, 21)] = "International Mother's language Day" | ||
|
||
# 17th March | ||
self[date(year, MAR, 17)] = "Sheikh Mujibur Rahman's Birthday " \ | ||
"and Children's Day" | ||
|
||
# 26th March | ||
self[date(year, MAR, 26)] = "Independence Day" | ||
|
||
# 14th April | ||
self[date(year, APR, 14)] = "Bengali New Year's Day" | ||
|
||
# 1st May | ||
self[date(year, MAY, 1)] = "May Day" | ||
|
||
# 15th AUG | ||
self[date(year, AUG, 15)] = "National Mourning Day" | ||
|
||
# 16th Dec | ||
self[date(year, DEC, 16)] = "Victory Day" | ||
|
||
|
||
class BD(Bangladesh): | ||
pass | ||
|
||
|
||
class BGD(Bangladesh): | ||
pass |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
# -*- coding: utf-8 -*- | ||
|
||
# python-holidays | ||
# --------------- | ||
# A fast, efficient Python library for generating country, province and state | ||
# specific sets of holidays on the fly. It aims to make determining whether a | ||
# specific date is a holiday as fast and flexible as possible. | ||
# | ||
# Author: ryanss <[email protected]> (c) 2014-2017 | ||
# dr-prodigy <[email protected]> (c) 2017-2020 | ||
# Website: https://github.com/dr-prodigy/python-holidays | ||
# License: MIT (see LICENSE file) | ||
|
||
from datetime import date | ||
|
||
from dateutil.easter import easter | ||
from dateutil.relativedelta import relativedelta as rd | ||
|
||
from holidays.constants import TUE, SAT, SUN | ||
from holidays.constants import JAN, FEB, MAR, APR, MAY, JUL, SEP, OCT, NOV, DEC | ||
from holidays.holiday_base import HolidayBase | ||
|
||
|
||
class Malawi(HolidayBase): | ||
|
||
def __init__(self, **kwargs): | ||
# https://www.officeholidays.com/countries/malawi | ||
# https://www.timeanddate.com/holidays/malawi/ | ||
self.country = 'MW' | ||
HolidayBase.__init__(self, **kwargs) | ||
|
||
def _populate(self, year): | ||
# Observed since 2000 | ||
if year > 1999: | ||
self[date(year, 1, 1)] = "New Year's Day" | ||
|
||
e = easter(year) | ||
good_friday = e - rd(days=2) | ||
easter_monday = e + rd(days=1) | ||
self[good_friday] = "Good Friday" | ||
self[easter_monday] = "Easter Monday" | ||
|
||
self[date(year, JAN, 15)] = "John Chilembwe Day" | ||
self[date(year, MAR, 3)] = "Martyrs Day" | ||
self[date(year, MAY, 1)] = "Labour Day" | ||
self[date(year, MAY, 14)] = "Kamuzu Day" | ||
self[date(year, JUL, 6)] = "Independence Day" | ||
self[date(year, OCT, 15)] = "Mother's Day" | ||
self[date(year, DEC, 25)] = "Christmas Day" | ||
self[date(year, DEC, 26)] = "Boxing Day" | ||
|
||
for k, v in list(self.items()): | ||
if self.observed and year > 1994: | ||
if k.weekday() == SUN: | ||
self[k + rd(days=1)] = v + " (Observed)" | ||
elif k.weekday() == SAT: | ||
self[k + rd(days=2)] = v + " (Observed)" | ||
|
||
|
||
class MW(Malawi): | ||
pass | ||
|
||
|
||
class MWI(Malawi): | ||
pass |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.