pandas-market-calendars 5.1.0__py3-none-any.whl → 5.1.3__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- pandas_market_calendars/__init__.py +39 -39
 - pandas_market_calendars/calendar_registry.py +58 -57
 - pandas_market_calendars/calendar_utils.py +1151 -1151
 - pandas_market_calendars/calendars/asx.py +100 -70
 - pandas_market_calendars/calendars/bmf.py +225 -219
 - pandas_market_calendars/calendars/bse.py +433 -425
 - pandas_market_calendars/calendars/cboe.py +153 -149
 - pandas_market_calendars/calendars/cme.py +417 -405
 - pandas_market_calendars/calendars/cme_globex_agriculture.py +172 -172
 - pandas_market_calendars/calendars/cme_globex_base.py +127 -119
 - pandas_market_calendars/calendars/cme_globex_crypto.py +166 -158
 - pandas_market_calendars/calendars/cme_globex_energy_and_metals.py +224 -216
 - pandas_market_calendars/calendars/cme_globex_equities.py +131 -123
 - pandas_market_calendars/calendars/cme_globex_fixed_income.py +136 -136
 - pandas_market_calendars/calendars/cme_globex_fx.py +101 -101
 - pandas_market_calendars/calendars/eurex.py +139 -131
 - pandas_market_calendars/calendars/eurex_fixed_income.py +106 -98
 - pandas_market_calendars/calendars/hkex.py +437 -431
 - pandas_market_calendars/calendars/ice.py +89 -81
 - pandas_market_calendars/calendars/iex.py +163 -155
 - pandas_market_calendars/calendars/jpx.py +125 -117
 - pandas_market_calendars/calendars/lse.py +126 -118
 - pandas_market_calendars/calendars/mirror.py +144 -144
 - pandas_market_calendars/calendars/nyse.py +1462 -1466
 - pandas_market_calendars/calendars/ose.py +124 -118
 - pandas_market_calendars/calendars/sifma.py +391 -383
 - pandas_market_calendars/calendars/six.py +144 -136
 - pandas_market_calendars/calendars/sse.py +305 -315
 - pandas_market_calendars/calendars/tase.py +232 -224
 - pandas_market_calendars/calendars/tsx.py +193 -185
 - pandas_market_calendars/class_registry.py +115 -115
 - pandas_market_calendars/holidays/cme.py +385 -385
 - pandas_market_calendars/holidays/cme_globex.py +214 -214
 - pandas_market_calendars/holidays/cn.py +1476 -1476
 - pandas_market_calendars/holidays/jp.py +401 -401
 - pandas_market_calendars/holidays/jpx_equinox.py +506 -506
 - pandas_market_calendars/holidays/nyse.py +1536 -1536
 - pandas_market_calendars/holidays/oz.py +82 -63
 - pandas_market_calendars/holidays/sifma.py +350 -350
 - pandas_market_calendars/holidays/uk.py +186 -186
 - pandas_market_calendars/holidays/us.py +376 -376
 - pandas_market_calendars/market_calendar.py +1006 -1008
 - {pandas_market_calendars-5.1.0.dist-info → pandas_market_calendars-5.1.3.dist-info}/METADATA +5 -4
 - pandas_market_calendars-5.1.3.dist-info/RECORD +50 -0
 - {pandas_market_calendars-5.1.0.dist-info → pandas_market_calendars-5.1.3.dist-info}/WHEEL +1 -1
 - pandas_market_calendars-5.1.0.dist-info/RECORD +0 -50
 - {pandas_market_calendars-5.1.0.dist-info → pandas_market_calendars-5.1.3.dist-info}/licenses/LICENSE +0 -0
 - {pandas_market_calendars-5.1.0.dist-info → pandas_market_calendars-5.1.3.dist-info}/licenses/NOTICE +0 -0
 - {pandas_market_calendars-5.1.0.dist-info → pandas_market_calendars-5.1.3.dist-info}/top_level.txt +0 -0
 
| 
         @@ -1,186 +1,186 @@ 
     | 
|
| 
       1 
     | 
    
         
            -
            # UK Holidays
         
     | 
| 
       2 
     | 
    
         
            -
             
     | 
| 
       3 
     | 
    
         
            -
            import pandas as pd
         
     | 
| 
       4 
     | 
    
         
            -
            from pandas import DateOffset, Timestamp
         
     | 
| 
       5 
     | 
    
         
            -
            from pandas.tseries.holiday import Holiday, MO, previous_friday, weekend_to_monday
         
     | 
| 
       6 
     | 
    
         
            -
             
     | 
| 
       7 
     | 
    
         
            -
            from pandas_market_calendars.market_calendar import MONDAY, TUESDAY
         
     | 
| 
       8 
     | 
    
         
            -
             
     | 
| 
       9 
     | 
    
         
            -
            # New Year's Eve
         
     | 
| 
       10 
     | 
    
         
            -
            LSENewYearsEve = Holiday(
         
     | 
| 
       11 
     | 
    
         
            -
                "New Year's Eve",
         
     | 
| 
       12 
     | 
    
         
            -
                month=12,
         
     | 
| 
       13 
     | 
    
         
            -
                day=31,
         
     | 
| 
       14 
     | 
    
         
            -
                observance=previous_friday,
         
     | 
| 
       15 
     | 
    
         
            -
            )
         
     | 
| 
       16 
     | 
    
         
            -
             
     | 
| 
       17 
     | 
    
         
            -
            # New Year's Day
         
     | 
| 
       18 
     | 
    
         
            -
            LSENewYearsDay = Holiday(
         
     | 
| 
       19 
     | 
    
         
            -
                "New Year's Day",
         
     | 
| 
       20 
     | 
    
         
            -
                month=1,
         
     | 
| 
       21 
     | 
    
         
            -
                day=1,
         
     | 
| 
       22 
     | 
    
         
            -
                observance=weekend_to_monday,
         
     | 
| 
       23 
     | 
    
         
            -
            )
         
     | 
| 
       24 
     | 
    
         
            -
             
     | 
| 
       25 
     | 
    
         
            -
            # Early May bank holiday has two exceptions based on the 50th and 75th anniversary of VE-Day
         
     | 
| 
       26 
     | 
    
         
            -
            # 1995-05-01 Early May bank holiday removed for VE-day 50th anniversary
         
     | 
| 
       27 
     | 
    
         
            -
            # 2020-05-04 Early May bank holiday removed for VE-day 75th anniversary
         
     | 
| 
       28 
     | 
    
         
            -
             
     | 
| 
       29 
     | 
    
         
            -
            # Early May bank holiday pre-1995
         
     | 
| 
       30 
     | 
    
         
            -
            MayBank_pre_1995 = Holiday(
         
     | 
| 
       31 
     | 
    
         
            -
                "Early May Bank Holiday",
         
     | 
| 
       32 
     | 
    
         
            -
                month=5,
         
     | 
| 
       33 
     | 
    
         
            -
                offset=DateOffset(weekday=MO(1)),
         
     | 
| 
       34 
     | 
    
         
            -
                day=1,
         
     | 
| 
       35 
     | 
    
         
            -
                end_date=Timestamp("1994-12-31"),
         
     | 
| 
       36 
     | 
    
         
            -
            )
         
     | 
| 
       37 
     | 
    
         
            -
             
     | 
| 
       38 
     | 
    
         
            -
            # Early May bank holiday post-1995 and pre-2020
         
     | 
| 
       39 
     | 
    
         
            -
            MayBank_post_1995_pre_2020 = Holiday(
         
     | 
| 
       40 
     | 
    
         
            -
                "Early May Bank Holiday",
         
     | 
| 
       41 
     | 
    
         
            -
                month=5,
         
     | 
| 
       42 
     | 
    
         
            -
                offset=DateOffset(weekday=MO(1)),
         
     | 
| 
       43 
     | 
    
         
            -
                day=1,
         
     | 
| 
       44 
     | 
    
         
            -
                start_date=Timestamp("1996-01-01"),
         
     | 
| 
       45 
     | 
    
         
            -
                end_date=Timestamp("2019-12-31"),
         
     | 
| 
       46 
     | 
    
         
            -
            )
         
     | 
| 
       47 
     | 
    
         
            -
             
     | 
| 
       48 
     | 
    
         
            -
            # Early May bank holiday post 2020
         
     | 
| 
       49 
     | 
    
         
            -
            MayBank_post_2020 = Holiday(
         
     | 
| 
       50 
     | 
    
         
            -
                "Early May Bank Holiday",
         
     | 
| 
       51 
     | 
    
         
            -
                month=5,
         
     | 
| 
       52 
     | 
    
         
            -
                offset=DateOffset(weekday=MO(1)),
         
     | 
| 
       53 
     | 
    
         
            -
                day=1,
         
     | 
| 
       54 
     | 
    
         
            -
                start_date=Timestamp("2021-01-01"),
         
     | 
| 
       55 
     | 
    
         
            -
            )
         
     | 
| 
       56 
     | 
    
         
            -
             
     | 
| 
       57 
     | 
    
         
            -
            # Spring bank holiday has two exceptions based on the Golden & Diamond Jubilee
         
     | 
| 
       58 
     | 
    
         
            -
            # 2002-05-27 Spring bank holiday removed for Golden Jubilee
         
     | 
| 
       59 
     | 
    
         
            -
            # 2012-05-28 Spring bank holiday removed for Diamond Jubilee
         
     | 
| 
       60 
     | 
    
         
            -
            # 2022-05-31 Spring bank holiday removed for Platinum Jubilee
         
     | 
| 
       61 
     | 
    
         
            -
             
     | 
| 
       62 
     | 
    
         
            -
            # Spring bank holiday
         
     | 
| 
       63 
     | 
    
         
            -
            SpringBank_pre_2002 = Holiday(
         
     | 
| 
       64 
     | 
    
         
            -
                "Spring Bank Holiday",
         
     | 
| 
       65 
     | 
    
         
            -
                month=5,
         
     | 
| 
       66 
     | 
    
         
            -
                day=31,
         
     | 
| 
       67 
     | 
    
         
            -
                offset=DateOffset(weekday=MO(-1)),
         
     | 
| 
       68 
     | 
    
         
            -
                end_date=Timestamp("2001-12-31"),
         
     | 
| 
       69 
     | 
    
         
            -
            )
         
     | 
| 
       70 
     | 
    
         
            -
             
     | 
| 
       71 
     | 
    
         
            -
            SpringBank_post_2002_pre_2012 = Holiday(
         
     | 
| 
       72 
     | 
    
         
            -
                "Spring Bank Holiday",
         
     | 
| 
       73 
     | 
    
         
            -
                month=5,
         
     | 
| 
       74 
     | 
    
         
            -
                day=31,
         
     | 
| 
       75 
     | 
    
         
            -
                offset=DateOffset(weekday=MO(-1)),
         
     | 
| 
       76 
     | 
    
         
            -
                start_date=Timestamp("2003-01-01"),
         
     | 
| 
       77 
     | 
    
         
            -
                end_date=Timestamp("2011-12-31"),
         
     | 
| 
       78 
     | 
    
         
            -
            )
         
     | 
| 
       79 
     | 
    
         
            -
             
     | 
| 
       80 
     | 
    
         
            -
            SpringBank_post_2012_pre_2022 = Holiday(
         
     | 
| 
       81 
     | 
    
         
            -
                "Spring Bank Holiday",
         
     | 
| 
       82 
     | 
    
         
            -
                month=5,
         
     | 
| 
       83 
     | 
    
         
            -
                day=31,
         
     | 
| 
       84 
     | 
    
         
            -
                offset=DateOffset(weekday=MO(-1)),
         
     | 
| 
       85 
     | 
    
         
            -
                start_date=Timestamp("2013-01-01"),
         
     | 
| 
       86 
     | 
    
         
            -
                end_date=Timestamp("2021-12-31"),
         
     | 
| 
       87 
     | 
    
         
            -
            )
         
     | 
| 
       88 
     | 
    
         
            -
             
     | 
| 
       89 
     | 
    
         
            -
            SpringBank_post_2022 = Holiday(
         
     | 
| 
       90 
     | 
    
         
            -
                "Spring Bank Holiday",
         
     | 
| 
       91 
     | 
    
         
            -
                month=5,
         
     | 
| 
       92 
     | 
    
         
            -
                day=31,
         
     | 
| 
       93 
     | 
    
         
            -
                offset=DateOffset(weekday=MO(-1)),
         
     | 
| 
       94 
     | 
    
         
            -
                start_date=Timestamp("2022-01-01"),
         
     | 
| 
       95 
     | 
    
         
            -
            )
         
     | 
| 
       96 
     | 
    
         
            -
             
     | 
| 
       97 
     | 
    
         
            -
            # Summer bank holiday
         
     | 
| 
       98 
     | 
    
         
            -
            SummerBank = Holiday(
         
     | 
| 
       99 
     | 
    
         
            -
                "Summer Bank Holiday",
         
     | 
| 
       100 
     | 
    
         
            -
                month=8,
         
     | 
| 
       101 
     | 
    
         
            -
                day=31,
         
     | 
| 
       102 
     | 
    
         
            -
                offset=DateOffset(weekday=MO(-1)),
         
     | 
| 
       103 
     | 
    
         
            -
            )
         
     | 
| 
       104 
     | 
    
         
            -
             
     | 
| 
       105 
     | 
    
         
            -
            # Christmas Eve
         
     | 
| 
       106 
     | 
    
         
            -
            ChristmasEve = Holiday(
         
     | 
| 
       107 
     | 
    
         
            -
                "Christmas Eve",
         
     | 
| 
       108 
     | 
    
         
            -
                month=12,
         
     | 
| 
       109 
     | 
    
         
            -
                day=24,
         
     | 
| 
       110 
     | 
    
         
            -
                observance=previous_friday,
         
     | 
| 
       111 
     | 
    
         
            -
            )
         
     | 
| 
       112 
     | 
    
         
            -
             
     | 
| 
       113 
     | 
    
         
            -
            # Christmas
         
     | 
| 
       114 
     | 
    
         
            -
            Christmas = Holiday(
         
     | 
| 
       115 
     | 
    
         
            -
                "Christmas",
         
     | 
| 
       116 
     | 
    
         
            -
                month=12,
         
     | 
| 
       117 
     | 
    
         
            -
                day=25,
         
     | 
| 
       118 
     | 
    
         
            -
            )
         
     | 
| 
       119 
     | 
    
         
            -
             
     | 
| 
       120 
     | 
    
         
            -
            # If christmas day is Saturday Monday 27th is a holiday
         
     | 
| 
       121 
     | 
    
         
            -
            # If christmas day is sunday the Tuesday 27th is a holiday
         
     | 
| 
       122 
     | 
    
         
            -
            WeekendChristmas = Holiday(
         
     | 
| 
       123 
     | 
    
         
            -
                "Weekend Christmas",
         
     | 
| 
       124 
     | 
    
         
            -
                month=12,
         
     | 
| 
       125 
     | 
    
         
            -
                day=27,
         
     | 
| 
       126 
     | 
    
         
            -
                days_of_week=(MONDAY, TUESDAY),
         
     | 
| 
       127 
     | 
    
         
            -
            )
         
     | 
| 
       128 
     | 
    
         
            -
             
     | 
| 
       129 
     | 
    
         
            -
            # Boxing day
         
     | 
| 
       130 
     | 
    
         
            -
            BoxingDay = Holiday(
         
     | 
| 
       131 
     | 
    
         
            -
                "Boxing Day",
         
     | 
| 
       132 
     | 
    
         
            -
                month=12,
         
     | 
| 
       133 
     | 
    
         
            -
                day=26,
         
     | 
| 
       134 
     | 
    
         
            -
            )
         
     | 
| 
       135 
     | 
    
         
            -
             
     | 
| 
       136 
     | 
    
         
            -
            # If boxing day is saturday then Monday 28th is a holiday
         
     | 
| 
       137 
     | 
    
         
            -
            # If boxing day is sunday then Tuesday 28th is a holiday
         
     | 
| 
       138 
     | 
    
         
            -
            WeekendBoxingDay = Holiday(
         
     | 
| 
       139 
     | 
    
         
            -
                "Weekend Boxing Day",
         
     | 
| 
       140 
     | 
    
         
            -
                month=12,
         
     | 
| 
       141 
     | 
    
         
            -
                day=28,
         
     | 
| 
       142 
     | 
    
         
            -
                days_of_week=(MONDAY, TUESDAY),
         
     | 
| 
       143 
     | 
    
         
            -
            )
         
     | 
| 
       144 
     | 
    
         
            -
             
     | 
| 
       145 
     | 
    
         
            -
            # One-off holiday additions and removals in England
         
     | 
| 
       146 
     | 
    
         
            -
             
     | 
| 
       147 
     | 
    
         
            -
            UniqueCloses = []
         
     | 
| 
       148 
     | 
    
         
            -
            # VE-Day Anniversary
         
     | 
| 
       149 
     | 
    
         
            -
            UniqueCloses.append(pd.Timestamp("1995-05-08", tz="UTC"))  # 50th Anniversary
         
     | 
| 
       150 
     | 
    
         
            -
            UniqueCloses.append(pd.Timestamp("2020-05-08", tz="UTC"))  # 75th Anniversary
         
     | 
| 
       151 
     | 
    
         
            -
             
     | 
| 
       152 
     | 
    
         
            -
            # Queen Elizabeth II Jubilees
         
     | 
| 
       153 
     | 
    
         
            -
            # Silver Jubilee
         
     | 
| 
       154 
     | 
    
         
            -
            UniqueCloses.append(pd.Timestamp("1977-06-07", tz="UTC"))
         
     | 
| 
       155 
     | 
    
         
            -
             
     | 
| 
       156 
     | 
    
         
            -
            # Golden Jubilee
         
     | 
| 
       157 
     | 
    
         
            -
            UniqueCloses.append(pd.Timestamp("2002-06-03", tz="UTC"))
         
     | 
| 
       158 
     | 
    
         
            -
            UniqueCloses.append(pd.Timestamp("2002-06-04", tz="UTC"))
         
     | 
| 
       159 
     | 
    
         
            -
             
     | 
| 
       160 
     | 
    
         
            -
            # Diamond Jubilee
         
     | 
| 
       161 
     | 
    
         
            -
            UniqueCloses.append(pd.Timestamp("2012-06-04", tz="UTC"))
         
     | 
| 
       162 
     | 
    
         
            -
            UniqueCloses.append(pd.Timestamp("2012-06-05", tz="UTC"))
         
     | 
| 
       163 
     | 
    
         
            -
             
     | 
| 
       164 
     | 
    
         
            -
            # Platinum Jubilee
         
     | 
| 
       165 
     | 
    
         
            -
            UniqueCloses.append(pd.Timestamp("2022-06-02", tz="UTC"))
         
     | 
| 
       166 
     | 
    
         
            -
            UniqueCloses.append(pd.Timestamp("2022-06-03", tz="UTC"))
         
     | 
| 
       167 
     | 
    
         
            -
             
     | 
| 
       168 
     | 
    
         
            -
            # State Funeral of Queen Elizabeth II
         
     | 
| 
       169 
     | 
    
         
            -
            UniqueCloses.append(pd.Timestamp("2022-09-19", tz="UTC"))
         
     | 
| 
       170 
     | 
    
         
            -
             
     | 
| 
       171 
     | 
    
         
            -
            # Royal Weddings
         
     | 
| 
       172 
     | 
    
         
            -
            UniqueCloses.append(
         
     | 
| 
       173 
     | 
    
         
            -
                pd.Timestamp("1973-11-14", tz="UTC")
         
     | 
| 
       174 
     | 
    
         
            -
            )  # Wedding Day of Princess Anne and Mark Phillips
         
     | 
| 
       175 
     | 
    
         
            -
            UniqueCloses.append(
         
     | 
| 
       176 
     | 
    
         
            -
                pd.Timestamp("1981-07-29", tz="UTC")
         
     | 
| 
       177 
     | 
    
         
            -
            )  # Wedding Day of Prince Charles and Diana Spencer
         
     | 
| 
       178 
     | 
    
         
            -
            UniqueCloses.append(
         
     | 
| 
       179 
     | 
    
         
            -
                pd.Timestamp("2011-04-29", tz="UTC")
         
     | 
| 
       180 
     | 
    
         
            -
            )  # Wedding Day of Prince William and Catherine Middleton
         
     | 
| 
       181 
     | 
    
         
            -
             
     | 
| 
       182 
     | 
    
         
            -
            # Coronation of King Charles III
         
     | 
| 
       183 
     | 
    
         
            -
            UniqueCloses.append(pd.Timestamp("2023-05-08", tz="UTC"))
         
     | 
| 
       184 
     | 
    
         
            -
             
     | 
| 
       185 
     | 
    
         
            -
            # Miscellaneous
         
     | 
| 
       186 
     | 
    
         
            -
            UniqueCloses.append(pd.Timestamp("1999-12-31", tz="UTC"))  # Eve of 3rd Millenium A.D.
         
     | 
| 
      
 1 
     | 
    
         
            +
            # UK Holidays
         
     | 
| 
      
 2 
     | 
    
         
            +
             
     | 
| 
      
 3 
     | 
    
         
            +
            import pandas as pd
         
     | 
| 
      
 4 
     | 
    
         
            +
            from pandas import DateOffset, Timestamp
         
     | 
| 
      
 5 
     | 
    
         
            +
            from pandas.tseries.holiday import Holiday, MO, previous_friday, weekend_to_monday
         
     | 
| 
      
 6 
     | 
    
         
            +
             
     | 
| 
      
 7 
     | 
    
         
            +
            from pandas_market_calendars.market_calendar import MONDAY, TUESDAY
         
     | 
| 
      
 8 
     | 
    
         
            +
             
     | 
| 
      
 9 
     | 
    
         
            +
            # New Year's Eve
         
     | 
| 
      
 10 
     | 
    
         
            +
            LSENewYearsEve = Holiday(
         
     | 
| 
      
 11 
     | 
    
         
            +
                "New Year's Eve",
         
     | 
| 
      
 12 
     | 
    
         
            +
                month=12,
         
     | 
| 
      
 13 
     | 
    
         
            +
                day=31,
         
     | 
| 
      
 14 
     | 
    
         
            +
                observance=previous_friday,
         
     | 
| 
      
 15 
     | 
    
         
            +
            )
         
     | 
| 
      
 16 
     | 
    
         
            +
             
     | 
| 
      
 17 
     | 
    
         
            +
            # New Year's Day
         
     | 
| 
      
 18 
     | 
    
         
            +
            LSENewYearsDay = Holiday(
         
     | 
| 
      
 19 
     | 
    
         
            +
                "New Year's Day",
         
     | 
| 
      
 20 
     | 
    
         
            +
                month=1,
         
     | 
| 
      
 21 
     | 
    
         
            +
                day=1,
         
     | 
| 
      
 22 
     | 
    
         
            +
                observance=weekend_to_monday,
         
     | 
| 
      
 23 
     | 
    
         
            +
            )
         
     | 
| 
      
 24 
     | 
    
         
            +
             
     | 
| 
      
 25 
     | 
    
         
            +
            # Early May bank holiday has two exceptions based on the 50th and 75th anniversary of VE-Day
         
     | 
| 
      
 26 
     | 
    
         
            +
            # 1995-05-01 Early May bank holiday removed for VE-day 50th anniversary
         
     | 
| 
      
 27 
     | 
    
         
            +
            # 2020-05-04 Early May bank holiday removed for VE-day 75th anniversary
         
     | 
| 
      
 28 
     | 
    
         
            +
             
     | 
| 
      
 29 
     | 
    
         
            +
            # Early May bank holiday pre-1995
         
     | 
| 
      
 30 
     | 
    
         
            +
            MayBank_pre_1995 = Holiday(
         
     | 
| 
      
 31 
     | 
    
         
            +
                "Early May Bank Holiday",
         
     | 
| 
      
 32 
     | 
    
         
            +
                month=5,
         
     | 
| 
      
 33 
     | 
    
         
            +
                offset=DateOffset(weekday=MO(1)),
         
     | 
| 
      
 34 
     | 
    
         
            +
                day=1,
         
     | 
| 
      
 35 
     | 
    
         
            +
                end_date=Timestamp("1994-12-31"),
         
     | 
| 
      
 36 
     | 
    
         
            +
            )
         
     | 
| 
      
 37 
     | 
    
         
            +
             
     | 
| 
      
 38 
     | 
    
         
            +
            # Early May bank holiday post-1995 and pre-2020
         
     | 
| 
      
 39 
     | 
    
         
            +
            MayBank_post_1995_pre_2020 = Holiday(
         
     | 
| 
      
 40 
     | 
    
         
            +
                "Early May Bank Holiday",
         
     | 
| 
      
 41 
     | 
    
         
            +
                month=5,
         
     | 
| 
      
 42 
     | 
    
         
            +
                offset=DateOffset(weekday=MO(1)),
         
     | 
| 
      
 43 
     | 
    
         
            +
                day=1,
         
     | 
| 
      
 44 
     | 
    
         
            +
                start_date=Timestamp("1996-01-01"),
         
     | 
| 
      
 45 
     | 
    
         
            +
                end_date=Timestamp("2019-12-31"),
         
     | 
| 
      
 46 
     | 
    
         
            +
            )
         
     | 
| 
      
 47 
     | 
    
         
            +
             
     | 
| 
      
 48 
     | 
    
         
            +
            # Early May bank holiday post 2020
         
     | 
| 
      
 49 
     | 
    
         
            +
            MayBank_post_2020 = Holiday(
         
     | 
| 
      
 50 
     | 
    
         
            +
                "Early May Bank Holiday",
         
     | 
| 
      
 51 
     | 
    
         
            +
                month=5,
         
     | 
| 
      
 52 
     | 
    
         
            +
                offset=DateOffset(weekday=MO(1)),
         
     | 
| 
      
 53 
     | 
    
         
            +
                day=1,
         
     | 
| 
      
 54 
     | 
    
         
            +
                start_date=Timestamp("2021-01-01"),
         
     | 
| 
      
 55 
     | 
    
         
            +
            )
         
     | 
| 
      
 56 
     | 
    
         
            +
             
     | 
| 
      
 57 
     | 
    
         
            +
            # Spring bank holiday has two exceptions based on the Golden & Diamond Jubilee
         
     | 
| 
      
 58 
     | 
    
         
            +
            # 2002-05-27 Spring bank holiday removed for Golden Jubilee
         
     | 
| 
      
 59 
     | 
    
         
            +
            # 2012-05-28 Spring bank holiday removed for Diamond Jubilee
         
     | 
| 
      
 60 
     | 
    
         
            +
            # 2022-05-31 Spring bank holiday removed for Platinum Jubilee
         
     | 
| 
      
 61 
     | 
    
         
            +
             
     | 
| 
      
 62 
     | 
    
         
            +
            # Spring bank holiday
         
     | 
| 
      
 63 
     | 
    
         
            +
            SpringBank_pre_2002 = Holiday(
         
     | 
| 
      
 64 
     | 
    
         
            +
                "Spring Bank Holiday",
         
     | 
| 
      
 65 
     | 
    
         
            +
                month=5,
         
     | 
| 
      
 66 
     | 
    
         
            +
                day=31,
         
     | 
| 
      
 67 
     | 
    
         
            +
                offset=DateOffset(weekday=MO(-1)),
         
     | 
| 
      
 68 
     | 
    
         
            +
                end_date=Timestamp("2001-12-31"),
         
     | 
| 
      
 69 
     | 
    
         
            +
            )
         
     | 
| 
      
 70 
     | 
    
         
            +
             
     | 
| 
      
 71 
     | 
    
         
            +
            SpringBank_post_2002_pre_2012 = Holiday(
         
     | 
| 
      
 72 
     | 
    
         
            +
                "Spring Bank Holiday",
         
     | 
| 
      
 73 
     | 
    
         
            +
                month=5,
         
     | 
| 
      
 74 
     | 
    
         
            +
                day=31,
         
     | 
| 
      
 75 
     | 
    
         
            +
                offset=DateOffset(weekday=MO(-1)),
         
     | 
| 
      
 76 
     | 
    
         
            +
                start_date=Timestamp("2003-01-01"),
         
     | 
| 
      
 77 
     | 
    
         
            +
                end_date=Timestamp("2011-12-31"),
         
     | 
| 
      
 78 
     | 
    
         
            +
            )
         
     | 
| 
      
 79 
     | 
    
         
            +
             
     | 
| 
      
 80 
     | 
    
         
            +
            SpringBank_post_2012_pre_2022 = Holiday(
         
     | 
| 
      
 81 
     | 
    
         
            +
                "Spring Bank Holiday",
         
     | 
| 
      
 82 
     | 
    
         
            +
                month=5,
         
     | 
| 
      
 83 
     | 
    
         
            +
                day=31,
         
     | 
| 
      
 84 
     | 
    
         
            +
                offset=DateOffset(weekday=MO(-1)),
         
     | 
| 
      
 85 
     | 
    
         
            +
                start_date=Timestamp("2013-01-01"),
         
     | 
| 
      
 86 
     | 
    
         
            +
                end_date=Timestamp("2021-12-31"),
         
     | 
| 
      
 87 
     | 
    
         
            +
            )
         
     | 
| 
      
 88 
     | 
    
         
            +
             
     | 
| 
      
 89 
     | 
    
         
            +
            SpringBank_post_2022 = Holiday(
         
     | 
| 
      
 90 
     | 
    
         
            +
                "Spring Bank Holiday",
         
     | 
| 
      
 91 
     | 
    
         
            +
                month=5,
         
     | 
| 
      
 92 
     | 
    
         
            +
                day=31,
         
     | 
| 
      
 93 
     | 
    
         
            +
                offset=DateOffset(weekday=MO(-1)),
         
     | 
| 
      
 94 
     | 
    
         
            +
                start_date=Timestamp("2022-01-01"),
         
     | 
| 
      
 95 
     | 
    
         
            +
            )
         
     | 
| 
      
 96 
     | 
    
         
            +
             
     | 
| 
      
 97 
     | 
    
         
            +
            # Summer bank holiday
         
     | 
| 
      
 98 
     | 
    
         
            +
            SummerBank = Holiday(
         
     | 
| 
      
 99 
     | 
    
         
            +
                "Summer Bank Holiday",
         
     | 
| 
      
 100 
     | 
    
         
            +
                month=8,
         
     | 
| 
      
 101 
     | 
    
         
            +
                day=31,
         
     | 
| 
      
 102 
     | 
    
         
            +
                offset=DateOffset(weekday=MO(-1)),
         
     | 
| 
      
 103 
     | 
    
         
            +
            )
         
     | 
| 
      
 104 
     | 
    
         
            +
             
     | 
| 
      
 105 
     | 
    
         
            +
            # Christmas Eve
         
     | 
| 
      
 106 
     | 
    
         
            +
            ChristmasEve = Holiday(
         
     | 
| 
      
 107 
     | 
    
         
            +
                "Christmas Eve",
         
     | 
| 
      
 108 
     | 
    
         
            +
                month=12,
         
     | 
| 
      
 109 
     | 
    
         
            +
                day=24,
         
     | 
| 
      
 110 
     | 
    
         
            +
                observance=previous_friday,
         
     | 
| 
      
 111 
     | 
    
         
            +
            )
         
     | 
| 
      
 112 
     | 
    
         
            +
             
     | 
| 
      
 113 
     | 
    
         
            +
            # Christmas
         
     | 
| 
      
 114 
     | 
    
         
            +
            Christmas = Holiday(
         
     | 
| 
      
 115 
     | 
    
         
            +
                "Christmas",
         
     | 
| 
      
 116 
     | 
    
         
            +
                month=12,
         
     | 
| 
      
 117 
     | 
    
         
            +
                day=25,
         
     | 
| 
      
 118 
     | 
    
         
            +
            )
         
     | 
| 
      
 119 
     | 
    
         
            +
             
     | 
| 
      
 120 
     | 
    
         
            +
            # If christmas day is Saturday Monday 27th is a holiday
         
     | 
| 
      
 121 
     | 
    
         
            +
            # If christmas day is sunday the Tuesday 27th is a holiday
         
     | 
| 
      
 122 
     | 
    
         
            +
            WeekendChristmas = Holiday(
         
     | 
| 
      
 123 
     | 
    
         
            +
                "Weekend Christmas",
         
     | 
| 
      
 124 
     | 
    
         
            +
                month=12,
         
     | 
| 
      
 125 
     | 
    
         
            +
                day=27,
         
     | 
| 
      
 126 
     | 
    
         
            +
                days_of_week=(MONDAY, TUESDAY),
         
     | 
| 
      
 127 
     | 
    
         
            +
            )
         
     | 
| 
      
 128 
     | 
    
         
            +
             
     | 
| 
      
 129 
     | 
    
         
            +
            # Boxing day
         
     | 
| 
      
 130 
     | 
    
         
            +
            BoxingDay = Holiday(
         
     | 
| 
      
 131 
     | 
    
         
            +
                "Boxing Day",
         
     | 
| 
      
 132 
     | 
    
         
            +
                month=12,
         
     | 
| 
      
 133 
     | 
    
         
            +
                day=26,
         
     | 
| 
      
 134 
     | 
    
         
            +
            )
         
     | 
| 
      
 135 
     | 
    
         
            +
             
     | 
| 
      
 136 
     | 
    
         
            +
            # If boxing day is saturday then Monday 28th is a holiday
         
     | 
| 
      
 137 
     | 
    
         
            +
            # If boxing day is sunday then Tuesday 28th is a holiday
         
     | 
| 
      
 138 
     | 
    
         
            +
            WeekendBoxingDay = Holiday(
         
     | 
| 
      
 139 
     | 
    
         
            +
                "Weekend Boxing Day",
         
     | 
| 
      
 140 
     | 
    
         
            +
                month=12,
         
     | 
| 
      
 141 
     | 
    
         
            +
                day=28,
         
     | 
| 
      
 142 
     | 
    
         
            +
                days_of_week=(MONDAY, TUESDAY),
         
     | 
| 
      
 143 
     | 
    
         
            +
            )
         
     | 
| 
      
 144 
     | 
    
         
            +
             
     | 
| 
      
 145 
     | 
    
         
            +
            # One-off holiday additions and removals in England
         
     | 
| 
      
 146 
     | 
    
         
            +
             
     | 
| 
      
 147 
     | 
    
         
            +
            UniqueCloses = []
         
     | 
| 
      
 148 
     | 
    
         
            +
            # VE-Day Anniversary
         
     | 
| 
      
 149 
     | 
    
         
            +
            UniqueCloses.append(pd.Timestamp("1995-05-08", tz="UTC"))  # 50th Anniversary
         
     | 
| 
      
 150 
     | 
    
         
            +
            UniqueCloses.append(pd.Timestamp("2020-05-08", tz="UTC"))  # 75th Anniversary
         
     | 
| 
      
 151 
     | 
    
         
            +
             
     | 
| 
      
 152 
     | 
    
         
            +
            # Queen Elizabeth II Jubilees
         
     | 
| 
      
 153 
     | 
    
         
            +
            # Silver Jubilee
         
     | 
| 
      
 154 
     | 
    
         
            +
            UniqueCloses.append(pd.Timestamp("1977-06-07", tz="UTC"))
         
     | 
| 
      
 155 
     | 
    
         
            +
             
     | 
| 
      
 156 
     | 
    
         
            +
            # Golden Jubilee
         
     | 
| 
      
 157 
     | 
    
         
            +
            UniqueCloses.append(pd.Timestamp("2002-06-03", tz="UTC"))
         
     | 
| 
      
 158 
     | 
    
         
            +
            UniqueCloses.append(pd.Timestamp("2002-06-04", tz="UTC"))
         
     | 
| 
      
 159 
     | 
    
         
            +
             
     | 
| 
      
 160 
     | 
    
         
            +
            # Diamond Jubilee
         
     | 
| 
      
 161 
     | 
    
         
            +
            UniqueCloses.append(pd.Timestamp("2012-06-04", tz="UTC"))
         
     | 
| 
      
 162 
     | 
    
         
            +
            UniqueCloses.append(pd.Timestamp("2012-06-05", tz="UTC"))
         
     | 
| 
      
 163 
     | 
    
         
            +
             
     | 
| 
      
 164 
     | 
    
         
            +
            # Platinum Jubilee
         
     | 
| 
      
 165 
     | 
    
         
            +
            UniqueCloses.append(pd.Timestamp("2022-06-02", tz="UTC"))
         
     | 
| 
      
 166 
     | 
    
         
            +
            UniqueCloses.append(pd.Timestamp("2022-06-03", tz="UTC"))
         
     | 
| 
      
 167 
     | 
    
         
            +
             
     | 
| 
      
 168 
     | 
    
         
            +
            # State Funeral of Queen Elizabeth II
         
     | 
| 
      
 169 
     | 
    
         
            +
            UniqueCloses.append(pd.Timestamp("2022-09-19", tz="UTC"))
         
     | 
| 
      
 170 
     | 
    
         
            +
             
     | 
| 
      
 171 
     | 
    
         
            +
            # Royal Weddings
         
     | 
| 
      
 172 
     | 
    
         
            +
            UniqueCloses.append(
         
     | 
| 
      
 173 
     | 
    
         
            +
                pd.Timestamp("1973-11-14", tz="UTC")
         
     | 
| 
      
 174 
     | 
    
         
            +
            )  # Wedding Day of Princess Anne and Mark Phillips
         
     | 
| 
      
 175 
     | 
    
         
            +
            UniqueCloses.append(
         
     | 
| 
      
 176 
     | 
    
         
            +
                pd.Timestamp("1981-07-29", tz="UTC")
         
     | 
| 
      
 177 
     | 
    
         
            +
            )  # Wedding Day of Prince Charles and Diana Spencer
         
     | 
| 
      
 178 
     | 
    
         
            +
            UniqueCloses.append(
         
     | 
| 
      
 179 
     | 
    
         
            +
                pd.Timestamp("2011-04-29", tz="UTC")
         
     | 
| 
      
 180 
     | 
    
         
            +
            )  # Wedding Day of Prince William and Catherine Middleton
         
     | 
| 
      
 181 
     | 
    
         
            +
             
     | 
| 
      
 182 
     | 
    
         
            +
            # Coronation of King Charles III
         
     | 
| 
      
 183 
     | 
    
         
            +
            UniqueCloses.append(pd.Timestamp("2023-05-08", tz="UTC"))
         
     | 
| 
      
 184 
     | 
    
         
            +
             
     | 
| 
      
 185 
     | 
    
         
            +
            # Miscellaneous
         
     | 
| 
      
 186 
     | 
    
         
            +
            UniqueCloses.append(pd.Timestamp("1999-12-31", tz="UTC"))  # Eve of 3rd Millenium A.D.
         
     |