reconnect moved files to git repo

This commit is contained in:
root
2025-08-01 04:33:03 -04:00
commit 5d3c35492d
23190 changed files with 4750716 additions and 0 deletions

View File

@ -0,0 +1,18 @@
# 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)
# ruff: noqa: F401
from holidays.financial.brasil_bolsa_balcao import BrasilBolsaBalcao, BVMF, B3
from holidays.financial.european_central_bank import EuropeanCentralBank, XECB, ECB, TAR
from holidays.financial.ice_futures_europe import ICEFuturesEurope, IFEU
from holidays.financial.ny_stock_exchange import NewYorkStockExchange, XNYS, NYSE

View File

@ -0,0 +1,109 @@
# 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.groups import ChristianHolidays, InternationalHolidays
from holidays.holiday_base import HolidayBase
class BrasilBolsaBalcao(HolidayBase, ChristianHolidays, InternationalHolidays):
"""Brasil, Bolsa, Balcão holidays.
References:
* [Decreto n. 155-B, de 14.01.1890](https://web.archive.org/web/20241226133739/https://www2.camara.leg.br/legin/fed/decret/1824-1899/decreto-155-b-14-janeiro-1890-517534-publicacaooriginal-1-pe.html)
* [Decreto n. 19.488, de 15.12.1930](https://web.archive.org/web/20241006041503/http://camara.leg.br/legin/fed/decret/1930-1939/decreto-19488-15-dezembro-1930-508040-republicacao-85201-pe.html)
* [Decreto n. 22.647, de 17.04.1933](https://web.archive.org/web/20220414202918/https://www2.camara.leg.br/legin/fed/decret/1930-1939/decreto-22647-17-abril-1933-558774-publicacaooriginal-80337-pe.html)
* [Lei n. 662, de 6.04.1949](https://web.archive.org/web/20240913060643/https://www2.camara.leg.br/legin/fed/lei/1940-1949/lei-662-6-abril-1949-347136-publicacaooriginal-1-pl.html)
* [Lei n. 6.802, de 30.06.1980](https://web.archive.org/web/20250206215621/http://www.planalto.gov.br/ccivil_03/leis/L6802.htm)
* [Resolução n. 2.516, de 29.06.1998](https://web.archive.org/web/20250428203302/https://www.bcb.gov.br/pre/normativos/res/1998/pdf/res_2516_v2_P.pdf)
* [Lei n. 14.759, de 21.12.2023](https://web.archive.org/web/20250402234552/https://www2.camara.leg.br/legin/fed/lei/2023/lei-14759-21-dezembro-2023-795091-publicacaooriginal-170522-pl.html)
Historical data:
* [Feriados ANBIMA 2001-2099](https://web.archive.org/web/20241209033536/https://www.anbima.com.br/feriados/)
* [Calendario de negociação B3](https://web.archive.org/web/20250126154858/https://www.b3.com.br/pt_br/solucoes/plataformas/puma-trading-system/para-participantes-e-traders/calendario-de-negociacao/feriados/)
"""
market = "BVMF"
default_language = "pt_BR"
supported_languages = ("en_US", "pt_BR", "uk")
# Decreto n. 155-B, de 14.01.1890
# Curiously enough, 1890 is also the year of foundation of the
# São Paulo Stock Exchange, which would later become the B3.
start_year = 1890
def __init__(self, *args, **kwargs) -> None:
ChristianHolidays.__init__(self)
InternationalHolidays.__init__(self)
super().__init__(*args, **kwargs)
def _populate_public_holidays(self):
# Universal Fraternization Day.
self._add_new_years_day(tr("Confraternização Universal"))
# Carnival.
carnival_name = tr("Carnaval")
self._add_carnival_monday(carnival_name)
self._add_carnival_tuesday(carnival_name)
# Resolução n. 2.516, de 29.06.1998
if self._year <= 1999:
# Holy Thursday.
self._add_holy_thursday(tr("Quinta-feira Santa"))
# Good Friday.
self._add_good_friday(tr("Sexta-feira Santa"))
# Tiradentes' Day was revoked by president Getúlio Vargas in
# december of 1930, through Decreto n. 19.488, but reinstated
# by the same president in 1933, through Decreto n. 22.647.
if self._year not in {1931, 1932}:
# Tiradentes' Day.
self._add_holiday_apr_21(tr("Tiradentes"))
if self._year >= 1925:
# Worker's Day.
self._add_labor_day(tr("Dia do Trabalhador"))
# Corpus Christi.
self._add_corpus_christi_day(tr("Corpus Christi"))
# Independence Day.
self._add_holiday_sep_7(tr("Independência do Brasil"))
# Lei n. 6.802, de 30.06.1980
if self._year >= 1980:
# Our Lady of Aparecida.
self._add_holiday_oct_12(tr("Nossa Senhora Aparecida"))
# All Souls' Day.
self._add_all_souls_day(tr("Finados"))
# Republic Proclamation Day.
self._add_holiday_nov_15(tr("Proclamação da República"))
# Lei n. 14.759, de 21.12.2023
if self._year >= 2024:
# National Day of Zumbi and Black Awareness.
self._add_holiday_nov_20(tr("Dia Nacional de Zumbi e da Consciência Negra"))
if self._year >= 1922:
# Christmas Day.
self._add_christmas_day(tr("Natal"))
class BVMF(BrasilBolsaBalcao):
pass
class B3(BrasilBolsaBalcao):
pass

View File

@ -0,0 +1,66 @@
# 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 holidays.calendars.gregorian import DEC
from holidays.groups import ChristianHolidays, InternationalHolidays, StaticHolidays
from holidays.holiday_base import HolidayBase
class EuropeanCentralBank(HolidayBase, ChristianHolidays, InternationalHolidays):
"""European Central Bank holidays.
References:
* <https://en.wikipedia.org/wiki/TARGET2>
* <https://web.archive.org/web/20250403115031/https://www.ecb.europa.eu/ecb/contacts/working-hours/html/index.en.html>
* <https://web.archive.org/web/20241109145056/https://www.ecb.europa.eu/press/pr/date/1999/html/pr990715_1.en.html>
* <https://web.archive.org/web/20241202213944/https://www.ecb.europa.eu/press/pr/date/2000/html/pr001214_4.en.html>
"""
market = "XECB"
start_year = 2000
def __init__(self, *args, **kwargs):
ChristianHolidays.__init__(self)
InternationalHolidays.__init__(self)
StaticHolidays.__init__(self, EuropeanCentralBankStaticHolidays)
super().__init__(*args, **kwargs)
def _populate_public_holidays(self):
self._add_new_years_day("New Year's Day")
self._add_good_friday("Good Friday")
self._add_easter_monday("Easter Monday")
self._add_labor_day("Labour Day")
self._add_christmas_day("Christmas Day")
self._add_christmas_day_two("Christmas Holiday")
class XECB(EuropeanCentralBank):
pass
class ECB(EuropeanCentralBank):
pass
class TAR(EuropeanCentralBank):
pass
class EuropeanCentralBankStaticHolidays:
special_public_holidays = {
2000: (DEC, 31, "Additional closing day"),
}

View File

@ -0,0 +1,45 @@
# 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 holidays.groups import ChristianHolidays, InternationalHolidays
from holidays.observed_holiday_base import ObservedHolidayBase, SAT_TO_NONE, SUN_TO_NEXT_MON
class ICEFuturesEurope(ObservedHolidayBase, ChristianHolidays, InternationalHolidays):
"""ICE Futures Europe holidays.
References:
* <https://web.archive.org/web/20241203121313/https://www.ice.com/publicdocs/futures/Trading_Schedule_Migrated_Liffe_Contracts.pdf>
* <https://web.archive.org/web/20241118133442/https://www.ice.com/publicdocs/Trading_Schedule.pdf>
* <https://web.archive.org/web/20230927015846/https://www.ice.com/publicdocs/Trading_Schedule.pdf>
* <https://web.archive.org/web/20211022183728/https://www.ice.com/publicdocs/Trading_Schedule.pdf>
"""
market = "IFEU"
start_year = 2014
def __init__(self, *args, **kwargs):
ChristianHolidays.__init__(self)
InternationalHolidays.__init__(self)
kwargs.setdefault("observed_rule", SAT_TO_NONE + SUN_TO_NEXT_MON)
super().__init__(*args, **kwargs)
def _populate_public_holidays(self):
self._move_holiday(self._add_new_years_day("New Year's Day"))
self._add_good_friday("Good Friday")
self._move_holiday(self._add_christmas_day("Christmas Day"))
class IFEU(ICEFuturesEurope):
pass

View File

@ -0,0 +1,287 @@
# 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 datetime import date
from holidays.calendars.gregorian import (
JAN,
FEB,
MAR,
APR,
MAY,
JUN,
JUL,
AUG,
SEP,
OCT,
NOV,
DEC,
_timedelta,
)
from holidays.groups import ChristianHolidays, InternationalHolidays, StaticHolidays
from holidays.observed_holiday_base import ObservedHolidayBase, SAT_TO_PREV_FRI, SUN_TO_NEXT_MON
class NewYorkStockExchange(
ObservedHolidayBase, ChristianHolidays, InternationalHolidays, StaticHolidays
):
"""New York Stock Exchange holidays.
References:
* <https://web.archive.org/web/20240118104341/https://www.nyse.com/publicdocs/nyse/regulation/nyse/NYSE_Rules.pdf>
Historical data:
* <https://web.archive.org/web/20221206064307/https://s3.amazonaws.com/armstrongeconomics-wp/2013/07/NYSE-Closings.pdf>
* <https://web.archive.org/web/20211101162021/https://www.nyse.com/markets/hours-calendars>
"""
market = "XNYS"
observed_label = "%s (observed)"
start_year = 1863
def __init__(self, *args, **kwargs):
ChristianHolidays.__init__(self)
InternationalHolidays.__init__(self)
StaticHolidays.__init__(self, NewYorkStockExchangeStaticHolidays)
kwargs.setdefault("observed_rule", SAT_TO_PREV_FRI + SUN_TO_NEXT_MON)
super().__init__(*args, **kwargs)
def _populate_public_holidays(self):
# New Year's Day.
name = "New Year's Day"
self._move_holiday(self._add_new_years_day(name))
# MLK, 3rd Monday of January.
if self._year >= 1998:
self._add_holiday_3rd_mon_of_jan("Martin Luther King Jr. Day")
# LINCOLN BIRTHDAY: observed 1896 - 1953 and 1968, Feb 12 (observed)
if 1896 <= self._year <= 1953 or self._year == 1968:
self._move_holiday(self._add_holiday_feb_12("Lincoln's Birthday"))
# WASHINGTON'S BIRTHDAY: Feb 22 (obs) until 1971, then 3rd Mon of Feb
name = "Washington's Birthday"
if self._year <= 1970:
self._move_holiday(self._add_holiday_feb_22(name))
else:
self._add_holiday_3rd_mon_of_feb(name)
# GOOD FRIDAY - closed every year except 1898, 1906, and 1907
if self._year not in {1898, 1906, 1907}:
self._add_good_friday("Good Friday")
# MEM DAY (May 30) - closed every year since 1873
# last Mon in May since 1971
if self._year >= 1873:
name = "Memorial Day"
if self._year <= 1970:
self._move_holiday(self._add_holiday_may_30(name))
else:
self._add_holiday_last_mon_of_may(name)
# FLAG DAY: June 14th 1916 - 1953
if 1916 <= self._year <= 1953:
self._move_holiday(self._add_holiday_jun_14("Flag Day"))
# JUNETEENTH: since 2022
if self._year >= 2022:
self._move_holiday(self._add_holiday_jun_19("Juneteenth National Independence Day"))
# INDEPENDENCE DAY (July 4) - history suggests closed every year
self._move_holiday(self._add_holiday_jul_4("Independence Day"))
# LABOR DAY - first mon in Sept, since 1887
if self._year >= 1887:
self._add_holiday_1st_mon_of_sep("Labor Day")
# COLUMBUS DAY/INDIGENOUS PPL DAY: Oct 12 - closed 1909-1953
if 1909 <= self._year <= 1953:
self._move_holiday(self._add_columbus_day("Columbus Day"))
# ELECTION DAY: Tuesday after first Monday in November (2 U.S. Code §7)
# closed until 1969, then closed pres years 1972-80
if self._year <= 1968 or self._year in {1972, 1976, 1980}:
self._add_holiday_1_day_past_1st_mon_of_nov("Election Day")
# VETERAN'S DAY: Nov 11 - closed 1918, 1921, 1934-1953
if self._year in {1918, 1921} or 1934 <= self._year <= 1953:
self._move_holiday(self._add_remembrance_day("Veteran's Day"))
# THXGIVING DAY: 4th Thurs in Nov - closed every year
self._add_holiday_4th_thu_of_nov("Thanksgiving Day")
# XMAS DAY: Dec 25th - every year
self._move_holiday(self._add_christmas_day("Christmas Day"))
# Special holidays.
if self._year == 1914:
# Beginning of WWI.
begin = date(self._year, JUL, 31)
end = date(self._year, NOV, 27)
for dt in (_timedelta(begin, n) for n in range((end - begin).days + 1)):
if self._is_weekend(dt) or dt in self:
continue
self._add_holiday("World War I", dt)
elif self._year == 1968:
begin = date(self._year, JUN, 12)
end = date(self._year, DEC, 24)
# Wednesday special holiday.
for dt in (_timedelta(begin, n) for n in range(0, (end - begin).days + 1, 7)):
self._add_holiday("Paper Crisis", dt)
class XNYS(NewYorkStockExchange):
pass
class NYSE(NewYorkStockExchange):
pass
class NewYorkStockExchangeStaticHolidays:
"""New York Stock Exchange special holidays.
References:
* <https://web.archive.org/web/20250421093104/https://guides.loc.gov/presidents-portraits/chronological>
* <https://web.archive.org/web/20250208135423/https://www.presidency.ucsb.edu/documents/proclamation-3561-national-day-mourning-for-president-kennedy>
"""
# Blizzard of 1888.
name_blizard_1888 = "Blizzard of 1888"
# Centennial of George Washington's Inauguration.
name_george_washington_centennial = "Centennial of George Washington's Inauguration"
# Columbian Celebration.
name_columbian_celebration = "Columbian Celebration"
# Heatless Day.
name_heatless_day = "Heatless Day"
# Catch Up Day.
name_catch_up_day = "Catch Up Day"
# Special Bank Holiday.
name_special_bank_holiday = "Special Bank Holiday"
# V-J Day (WWII).
name_vj_day_wwii = "V-J Day (WWII)"
# Christmas Eve.
name_christmas_eve = "Christmas Eve"
# Closed for Sept 11, 2001 Attacks.
name_sept11_attacks = "Closed for Sept 11, 2001 Attacks"
# Hurricane Sandy.
name_hurricane_sandy = "Hurricane Sandy"
special_public_holidays = {
1888: (
(MAR, 12, name_blizard_1888),
(MAR, 13, name_blizard_1888),
(NOV, 30, "Thanksgiving Friday 1888"),
),
1889: (
(APR, 29, name_george_washington_centennial),
(APR, 30, name_george_washington_centennial),
(MAY, 1, name_george_washington_centennial),
),
1892: (
(OCT, 12, name_columbian_celebration),
(OCT, 21, name_columbian_celebration),
),
1893: (APR, 27, name_columbian_celebration),
1897: (APR, 27, "Grant's Birthday"),
1898: (MAY, 4, "Charter Day"),
1899: (
(MAY, 29, "Monday before Decoration Day"),
(JUL, 3, "Monday before Independence Day"),
(SEP, 29, "Admiral Dewey Celebration"),
),
1900: (DEC, 24, name_christmas_eve),
1901: (
(JUL, 5, "Friday after Independence Day"),
(SEP, 19, "National Day of Mourning for President WIlliam McKinley"),
),
1903: (APR, 22, "Opening of new NYSE building"),
1917: (JUN, 5, "Draft Registration Day"),
1918: (
(JAN, 28, name_heatless_day),
(FEB, 4, name_heatless_day),
(FEB, 11, name_heatless_day),
(SEP, 12, "Draft Registration Day"),
(NOV, 11, "Armistice Day"),
),
1919: (
(MAR, 25, "Homecoming Day for 27th Division"),
(MAY, 6, "Parade Day for 77th Division"),
(SEP, 10, "Return of General Pershing"),
),
1923: (
(AUG, 3, "Death of President Warren G. Harding"),
(AUG, 10, "National Day of Mourning for President Warren G. Harding"),
),
1927: (JUN, 13, "Parade for Colonel Charles Lindbergh"),
1929: (
(NOV, 1, name_catch_up_day),
(NOV, 29, name_catch_up_day),
),
1933: (
(MAR, 6, name_special_bank_holiday),
(MAR, 7, name_special_bank_holiday),
(MAR, 8, name_special_bank_holiday),
(MAR, 9, name_special_bank_holiday),
(MAR, 10, name_special_bank_holiday),
(MAR, 13, name_special_bank_holiday),
(MAR, 14, name_special_bank_holiday),
),
1945: (
(AUG, 15, name_vj_day_wwii),
(AUG, 16, name_vj_day_wwii),
(DEC, 24, name_christmas_eve),
),
1954: (DEC, 24, name_christmas_eve),
1956: (DEC, 24, name_christmas_eve),
1958: (DEC, 26, "Day after Christmas"),
1961: (MAY, 29, "Day before Decoration Day"),
1963: (NOV, 25, "National Day of Mourning for President John F. Kennedy"),
1965: (DEC, 24, name_christmas_eve),
1968: (
(APR, 9, "National Day of Mourning for Martin Luther King Jr."),
(JUL, 5, "Day after Independence Day"),
),
1969: (
(FEB, 10, "Heavy Snow"),
(MAR, 31, "National Day of Mourning for former President Dwight D. Eisenhower"),
(JUL, 21, "National Participation in Lunar Exploration"),
),
1972: (DEC, 28, "National Day of Mourning for former President Harry S. Truman"),
1973: (JAN, 25, "National Day of Mourning for former President Lyndon B. Johnson"),
1977: (JUL, 14, "Blackout in New York City"),
1985: (SEP, 27, "Hurricane Gloria"),
1994: (APR, 27, "National Day of Mourning for former President Richard M. Nixon"),
2001: (
(SEP, 11, name_sept11_attacks),
(SEP, 12, name_sept11_attacks),
(SEP, 13, name_sept11_attacks),
(SEP, 14, name_sept11_attacks),
),
2004: (JUN, 11, "National Day of Mourning for former President Ronald Reagan"),
2007: (JAN, 2, "National Day of Mourning for former President Gerald R. Ford"),
2012: (
(OCT, 29, name_hurricane_sandy),
(OCT, 30, name_hurricane_sandy),
),
2018: (DEC, 5, "National Day of Mourning for former President George H. W. Bush"),
2025: (JAN, 9, "National Day of Mourning for former President Jimmy Carter"),
}