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

Refactor XNYS holidays: standardize US market holidays days of mourning entries #2213

Merged
merged 8 commits into from
Jan 6, 2025
126 changes: 81 additions & 45 deletions holidays/financial/ny_stock_exchange.py
Original file line number Diff line number Diff line change
Expand Up @@ -147,40 +147,76 @@ class NYSE(NewYorkStockExchange):


class NewYorkStockExchangeStaticHolidays:
"""
References:
- https://guides.loc.gov/presidents-portraits/chronological
- 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, "Blizzard of 1888"),
(MAR, 13, "Blizzard of 1888"),
(MAR, 12, name_blizard_1888),
(MAR, 13, name_blizard_1888),
(NOV, 30, "Thanksgiving Friday 1888"),
),
1889: (
(APR, 29, "Centennial of Washington Inauguration"),
(APR, 30, "Centennial of Washington Inauguration"),
(MAY, 1, "Centennial of Washington Inauguration"),
(APR, 29, name_george_washington_centennial),
(APR, 30, name_george_washington_centennial),
(MAY, 1, name_george_washington_centennial),
),
1892: (
(OCT, 12, "Columbian Celebration"),
(OCT, 21, "Columbian Celebration"),
(OCT, 12, name_columbian_celebration),
(OCT, 21, name_columbian_celebration),
),
1893: (APR, 27, "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, "Christmas Eve"),
1900: (DEC, 24, name_christmas_eve),
1901: (
(JUL, 5, "Friday after Independence Day"),
(SEP, 19, "Funeral of President McKinley"),
(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, "Heatless Day"),
(FEB, 4, "Heatless Day"),
(FEB, 11, "Heatless Day"),
(JAN, 28, name_heatless_day),
(FEB, 4, name_heatless_day),
(FEB, 11, name_heatless_day),
(SEP, 12, "Draft Registration Day"),
(NOV, 11, "Armistice Day"),
),
Expand All @@ -191,59 +227,59 @@ class NewYorkStockExchangeStaticHolidays:
),
1923: (
(AUG, 3, "Death of President Warren G. Harding"),
(AUG, 10, "Funeral 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, "Catch Up Day"),
(NOV, 29, "Catch Up Day"),
(NOV, 1, name_catch_up_day),
(NOV, 29, name_catch_up_day),
),
1933: (
(MAR, 6, "Special Bank Holiday"),
(MAR, 7, "Special Bank Holiday"),
(MAR, 8, "Special Bank Holiday"),
(MAR, 9, "Special Bank Holiday"),
(MAR, 10, "Special Bank Holiday"),
(MAR, 13, "Special Bank Holiday"),
(MAR, 14, "Special Bank Holiday"),
(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, "V-J Day (WWII)"),
(AUG, 16, "V-J Day (WWII)"),
(DEC, 24, "Christmas Eve"),
(AUG, 15, name_vj_day_wwii),
(AUG, 16, name_vj_day_wwii),
(DEC, 24, name_christmas_eve),
),
1954: (DEC, 24, "Christmas Eve"),
1956: (DEC, 24, "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, "Funeral of President John F. Kennedy"),
1965: (DEC, 24, "Christmas Eve"),
1963: (NOV, 25, "National Day of Mourning for President John F. Kennedy"),
1965: (DEC, 24, name_christmas_eve),
1968: (
(APR, 9, "Day of Mourning for Martin Luther King Jr."),
(APR, 9, "National Day of Mourning for Martin Luther King Jr."),
(JUL, 5, "Day after Independence Day"),
),
1969: (
(FEB, 10, "Heavy Snow"),
(MAR, 31, "Funeral of President Dwight D. Eisenhower"),
(MAR, 31, "National Day of Mourning for former President Dwight D. Eisenhower"),
(JUL, 21, "National Participation in Lunar Exploration"),
),
1972: (DEC, 28, "Funeral for President Harry S. Truman"),
1973: (JAN, 25, "Funeral for President Lyndon B. Johnson"),
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, "Funeral for President Richard M. Nixon"),
1994: (APR, 27, "National Day of Mourning for former President Richard M. Nixon"),
2001: (
(SEP, 11, "Closed for Sept 11, 2001 Attacks"),
(SEP, 12, "Closed for Sept 11, 2001 Attacks"),
(SEP, 13, "Closed for Sept 11, 2001 Attacks"),
(SEP, 14, "Closed for Sept 11, 2001 Attacks"),
(SEP, 11, name_sept11_attacks),
(SEP, 12, name_sept11_attacks),
(SEP, 13, name_sept11_attacks),
(SEP, 14, name_sept11_attacks),
),
2004: (JUN, 11, "Day of Mourning for President Ronald W. Reagan"),
2007: (JAN, 2, "Day of Mourning for President Gerald R. Ford"),
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, "Hurricane Sandy"),
(OCT, 30, "Hurricane Sandy"),
(OCT, 29, name_hurricane_sandy),
(OCT, 30, name_hurricane_sandy),
),
2018: (DEC, 5, "Day of Mourning for President George H.W. Bush"),
2025: (JAN, 9, "Day of Mourning for President Jimmy Carter"),
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"),
}
20 changes: 10 additions & 10 deletions snapshots/financial/XNYS.json
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@
"1963-07-04": "Independence Day",
"1963-09-02": "Labor Day",
"1963-11-05": "Election Day",
"1963-11-25": "Funeral of President John F. Kennedy",
"1963-11-25": "National Day of Mourning for President John F. Kennedy",
"1963-11-28": "Thanksgiving Day",
"1963-12-25": "Christmas Day",
"1964-01-01": "New Year's Day",
Expand Down Expand Up @@ -182,7 +182,7 @@
"1968-01-01": "New Year's Day",
"1968-02-12": "Lincoln's Birthday",
"1968-02-22": "Washington's Birthday",
"1968-04-09": "Day of Mourning for Martin Luther King Jr.",
"1968-04-09": "National Day of Mourning for Martin Luther King Jr.",
"1968-04-12": "Good Friday",
"1968-05-30": "Memorial Day",
"1968-06-12": "Paper Crisis",
Expand Down Expand Up @@ -222,7 +222,7 @@
"1969-01-01": "New Year's Day",
"1969-02-10": "Heavy Snow",
"1969-02-21": "Washington's Birthday (observed)",
"1969-03-31": "Funeral of President Dwight D. Eisenhower",
"1969-03-31": "National Day of Mourning for former President Dwight D. Eisenhower",
"1969-04-04": "Good Friday",
"1969-05-30": "Memorial Day",
"1969-07-04": "Independence Day",
Expand Down Expand Up @@ -254,9 +254,9 @@
"1972-11-07": "Election Day",
"1972-11-23": "Thanksgiving Day",
"1972-12-25": "Christmas Day",
"1972-12-28": "Funeral for President Harry S. Truman",
"1972-12-28": "National Day of Mourning for former President Harry S. Truman",
"1973-01-01": "New Year's Day",
"1973-01-25": "Funeral for President Lyndon B. Johnson",
"1973-01-25": "National Day of Mourning for former President Lyndon B. Johnson",
"1973-02-19": "Washington's Birthday",
"1973-04-20": "Good Friday",
"1973-05-28": "Memorial Day",
Expand Down Expand Up @@ -428,7 +428,7 @@
"1993-12-24": "Christmas Day (observed)",
"1994-02-21": "Washington's Birthday",
"1994-04-01": "Good Friday",
"1994-04-27": "Funeral for President Richard M. Nixon",
"1994-04-27": "National Day of Mourning for former President Richard M. Nixon",
"1994-05-30": "Memorial Day",
"1994-07-04": "Independence Day",
"1994-09-05": "Labor Day",
Expand Down Expand Up @@ -520,7 +520,7 @@
"2004-02-16": "Washington's Birthday",
"2004-04-09": "Good Friday",
"2004-05-31": "Memorial Day",
"2004-06-11": "Day of Mourning for President Ronald W. Reagan",
"2004-06-11": "National Day of Mourning for former President Ronald Reagan",
"2004-07-05": "Independence Day (observed)",
"2004-09-06": "Labor Day",
"2004-11-25": "Thanksgiving Day",
Expand All @@ -543,7 +543,7 @@
"2006-11-23": "Thanksgiving Day",
"2006-12-25": "Christmas Day",
"2007-01-01": "New Year's Day",
"2007-01-02": "Day of Mourning for President Gerald R. Ford",
"2007-01-02": "National Day of Mourning for former President Gerald R. Ford",
"2007-01-15": "Martin Luther King Jr. Day",
"2007-02-19": "Washington's Birthday",
"2007-04-06": "Good Friday",
Expand Down Expand Up @@ -651,7 +651,7 @@
"2018-07-04": "Independence Day",
"2018-09-03": "Labor Day",
"2018-11-22": "Thanksgiving Day",
"2018-12-05": "Day of Mourning for President George H.W. Bush",
"2018-12-05": "National Day of Mourning for former President George H. W. Bush",
"2018-12-25": "Christmas Day",
"2019-01-01": "New Year's Day",
"2019-01-21": "Martin Luther King Jr. Day",
Expand Down Expand Up @@ -710,7 +710,7 @@
"2024-11-28": "Thanksgiving Day",
"2024-12-25": "Christmas Day",
"2025-01-01": "New Year's Day",
"2025-01-09": "Day of Mourning for President Jimmy Carter",
"2025-01-09": "National Day of Mourning for former President Jimmy Carter",
"2025-01-20": "Martin Luther King Jr. Day",
"2025-02-17": "Washington's Birthday",
"2025-04-18": "Good Friday",
Expand Down
Loading
Loading