File: burundi.py

package info (click to toggle)
python-holidays 0.86-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 57,296 kB
  • sloc: python: 117,830; javascript: 85; makefile: 59
file content (155 lines) | stat: -rw-r--r-- 5,697 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
#  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.
#
#  Authors: Vacanza Team and individual contributors (see CONTRIBUTORS file)
#           dr-prodigy <dr.prodigy.github@gmail.com> (c) 2017-2023
#           ryanss <ryanssdev@icloud.com> (c) 2014-2017
#  Website: https://github.com/vacanza/holidays
#  License: MIT (see LICENSE file)

from gettext import gettext as tr

from holidays.calendars import _CustomIslamicHolidays
from holidays.calendars.gregorian import JUN, JUL, SEP, OCT
from holidays.groups import ChristianHolidays, IslamicHolidays, InternationalHolidays
from holidays.observed_holiday_base import ObservedHolidayBase, SUN_TO_NEXT_MON


class Burundi(ObservedHolidayBase, ChristianHolidays, InternationalHolidays, IslamicHolidays):
    """Burundi holidays.

    References:
        * [Décret n° 100/150 du 7 Juin 2021](https://web.archive.org/web/20240514031141/https://www.presidence.gov.bi/wp-content/uploads/2021/06/Liste-et-regime-des-jours-feries.pdf)
        * [Republic of Burundi's Ministry of Foreign Affairs Public Holidays List](https://web.archive.org/web/20250820080112/https://www.mae.gov.bi/en/official-holidays/)
        * <https://web.archive.org/web/20250820095115/https://www.timeanddate.com/holidays/burundi/2025>

    When it appears inappropriate for a public holiday listed in Article 1 to be observed because
    it coincides with a Sunday, it shall be postponed to the following working day, which shall
    accordingly be considered a public holiday and observed as such.
    """

    country = "BI"
    # %s (estimated).
    estimated_label = tr("%s (estimé)")
    default_language = "fr_BI"
    # %s (observed, estimated).
    observed_estimated_label = tr("%s (observé, estimé)")
    # %s (observed).
    observed_label = tr("%s (observé)")
    start_year = 1962
    supported_languages = ("en_US", "fr_BI")

    def __init__(self, *args, islamic_show_estimated: bool = True, **kwargs):
        """
        Args:
            islamic_show_estimated:
                Whether to add "estimated" label to Islamic holidays name
                if holiday date is estimated.
        """
        ChristianHolidays.__init__(self)
        InternationalHolidays.__init__(self)
        IslamicHolidays.__init__(
            self, cls=BurundiIslamicHolidays, show_estimated=islamic_show_estimated
        )
        kwargs.setdefault("observed_rule", SUN_TO_NEXT_MON)
        super().__init__(*args, **kwargs)

    def _populate_public_holidays(self):
        dts_observed = set()

        # New Year's Day.
        dts_observed.add(self._add_new_years_day(tr("Jour de l'an")))

        if self._year >= 1992:
            # Unity Day.
            dts_observed.add(self._add_holiday_feb_5(tr("Fête de l'Unité")))

        if self._year >= 1995:
            dts_observed.add(
                self._add_holiday_apr_6(
                    # Commemoration of the Assassination of President Cyprien Ntaryamira.
                    tr("Commémoration de l'Assassinat du Président Cyprien Ntaryamira")
                )
            )

        # International Labor Day.
        dts_observed.add(self._add_labor_day(tr("Fête Internationale du Travail")))

        # Ascension Day.
        self._add_ascension_thursday(tr("Jour de l'Ascension"))

        if self._year >= 2022:
            dts_observed.add(
                self._add_holiday_jun_8(
                    # National Day of Patriotism and Commemoration of the Death of
                    # President Pierre Nkurunziza.
                    tr(
                        "Journée Nationale du Patriotisme et Commémoration de la Mort "
                        "du Président Pierre Nkurunziza"
                    )
                )
            )

        # Independence Day.
        dts_observed.add(self._add_holiday_jul_1(tr("Anniversaire de l'Indépendance")))

        # Assumption Day.
        dts_observed.add(self._add_assumption_of_mary_day(tr("Assomption")))

        dts_observed.add(
            self._add_holiday_oct_13(
                # Commemoration of the Assassination of National Hero, Prince Louis Rwagasore.
                tr("Commémoration de l'Assassinat du Héros National, le Prince Louis Rwagasore")
            )
        )
        if self._year >= 1994:
            dts_observed.add(
                self._add_holiday_oct_21(
                    # Commemoration of the Assassination of President Melchior Ndadaye.
                    tr("Commémoration de l'Assassinat du Président Melchior Ndadaye")
                )
            )

        # All Saints' Day.
        dts_observed.add(self._add_all_saints_day(tr("Toussaint")))

        # Christmas Day.
        dts_observed.add(self._add_christmas_day(tr("Noël")))

        # Eid al-Fitr.
        dts_observed.update(self._add_eid_al_fitr_day(tr("Aid-El-Fithr")))

        # Eid al-Adha.
        dts_observed.update(self._add_eid_al_adha_day(tr("Aid-El-Adha")))

        if self.observed:
            self._populate_observed(dts_observed)


class BI(Burundi):
    pass


class BDI(Burundi):
    pass


class BurundiIslamicHolidays(_CustomIslamicHolidays):
    EID_AL_ADHA_DATES_CONFIRMED_YEARS = (2014, 2025)
    EID_AL_ADHA_DATES = {
        2014: (OCT, 5),
        2015: (SEP, 24),
        2016: (SEP, 13),
        2017: (SEP, 2),
    }

    EID_AL_FITR_DATES_CONFIRMED_YEARS = (2014, 2025)
    EID_AL_FITR_DATES = {
        2014: (JUL, 29),
        2015: (JUL, 18),
        2016: (JUL, 7),
        2017: (JUN, 26),
    }