pandas-market-calendars 4.3.1__py3-none-any.whl → 4.3.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 +38 -37
- pandas_market_calendars/calendar_registry.py +53 -48
- pandas_market_calendars/calendar_utils.py +261 -225
- pandas_market_calendars/calendars/asx.py +66 -63
- pandas_market_calendars/calendars/bmf.py +206 -227
- pandas_market_calendars/calendars/bse.py +407 -409
- pandas_market_calendars/calendars/cboe.py +145 -115
- pandas_market_calendars/calendars/cme.py +402 -240
- pandas_market_calendars/calendars/cme_globex_agriculture.py +126 -103
- pandas_market_calendars/calendars/cme_globex_base.py +119 -103
- pandas_market_calendars/calendars/cme_globex_crypto.py +160 -147
- pandas_market_calendars/calendars/cme_globex_energy_and_metals.py +216 -138
- pandas_market_calendars/calendars/cme_globex_equities.py +123 -104
- pandas_market_calendars/calendars/cme_globex_fixed_income.py +136 -113
- pandas_market_calendars/calendars/cme_globex_fx.py +101 -78
- pandas_market_calendars/calendars/eurex.py +139 -119
- pandas_market_calendars/calendars/eurex_fixed_income.py +98 -0
- pandas_market_calendars/calendars/hkex.py +426 -408
- pandas_market_calendars/calendars/ice.py +81 -65
- pandas_market_calendars/calendars/iex.py +112 -98
- pandas_market_calendars/calendars/jpx.py +109 -103
- pandas_market_calendars/calendars/lse.py +114 -91
- pandas_market_calendars/calendars/mirror.py +130 -114
- pandas_market_calendars/calendars/nyse.py +1324 -1127
- pandas_market_calendars/calendars/ose.py +116 -150
- pandas_market_calendars/calendars/sifma.py +350 -297
- pandas_market_calendars/calendars/six.py +132 -114
- pandas_market_calendars/calendars/sse.py +311 -290
- pandas_market_calendars/calendars/tase.py +197 -195
- pandas_market_calendars/calendars/tsx.py +181 -159
- pandas_market_calendars/class_registry.py +22 -16
- pandas_market_calendars/holidays/cme.py +385 -340
- pandas_market_calendars/holidays/cme_globex.py +214 -198
- pandas_market_calendars/holidays/cn.py +1455 -1436
- pandas_market_calendars/holidays/jp.py +398 -396
- pandas_market_calendars/holidays/jpx_equinox.py +453 -95
- pandas_market_calendars/holidays/nyse.py +1531 -1472
- pandas_market_calendars/holidays/oz.py +63 -65
- pandas_market_calendars/holidays/sifma.py +338 -321
- pandas_market_calendars/holidays/uk.py +32 -26
- pandas_market_calendars/holidays/us.py +376 -360
- pandas_market_calendars/market_calendar.py +895 -789
- {pandas_market_calendars-4.3.1.dist-info → pandas_market_calendars-4.3.3.dist-info}/METADATA +7 -5
- pandas_market_calendars-4.3.3.dist-info/RECORD +50 -0
- {pandas_market_calendars-4.3.1.dist-info → pandas_market_calendars-4.3.3.dist-info}/WHEEL +1 -1
- pandas_market_calendars-4.3.1.dist-info/RECORD +0 -49
- {pandas_market_calendars-4.3.1.dist-info → pandas_market_calendars-4.3.3.dist-info}/LICENSE +0 -0
- {pandas_market_calendars-4.3.1.dist-info → pandas_market_calendars-4.3.3.dist-info}/NOTICE +0 -0
- {pandas_market_calendars-4.3.1.dist-info → pandas_market_calendars-4.3.3.dist-info}/top_level.txt +0 -0
| @@ -1,119 +1,139 @@ | |
| 1 | 
            -
            #
         | 
| 2 | 
            -
            # kewlfft
         | 
| 3 | 
            -
            #
         | 
| 4 | 
            -
             | 
| 5 | 
            -
            from datetime import time
         | 
| 6 | 
            -
             | 
| 7 | 
            -
            from pandas.tseries.holiday import  | 
| 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 | 
            -
            # If  | 
| 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 | 
            -
                @property
         | 
| 112 | 
            -
                def  | 
| 113 | 
            -
                    return  | 
| 114 | 
            -
                         | 
| 115 | 
            -
             | 
| 116 | 
            -
                             | 
| 117 | 
            -
                             | 
| 118 | 
            -
             | 
| 119 | 
            -
             | 
| 1 | 
            +
            #
         | 
| 2 | 
            +
            # kewlfft
         | 
| 3 | 
            +
            #
         | 
| 4 | 
            +
             | 
| 5 | 
            +
            from datetime import time
         | 
| 6 | 
            +
             | 
| 7 | 
            +
            from pandas.tseries.holiday import (
         | 
| 8 | 
            +
                AbstractHolidayCalendar,
         | 
| 9 | 
            +
                EasterMonday,
         | 
| 10 | 
            +
                GoodFriday,
         | 
| 11 | 
            +
                Holiday,
         | 
| 12 | 
            +
                previous_friday,
         | 
| 13 | 
            +
            )
         | 
| 14 | 
            +
            from pytz import timezone
         | 
| 15 | 
            +
             | 
| 16 | 
            +
            from pandas_market_calendars.market_calendar import (
         | 
| 17 | 
            +
                FRIDAY,
         | 
| 18 | 
            +
                MONDAY,
         | 
| 19 | 
            +
                MarketCalendar,
         | 
| 20 | 
            +
                THURSDAY,
         | 
| 21 | 
            +
                TUESDAY,
         | 
| 22 | 
            +
                WEDNESDAY,
         | 
| 23 | 
            +
            )
         | 
| 24 | 
            +
             | 
| 25 | 
            +
            # New Year's Eve
         | 
| 26 | 
            +
            EUREXNewYearsEve = Holiday(
         | 
| 27 | 
            +
                "New Year's Eve",
         | 
| 28 | 
            +
                month=12,
         | 
| 29 | 
            +
                day=31,
         | 
| 30 | 
            +
                observance=previous_friday,
         | 
| 31 | 
            +
            )
         | 
| 32 | 
            +
            # New Year's Day
         | 
| 33 | 
            +
            EUREXNewYearsDay = Holiday(
         | 
| 34 | 
            +
                "New Year's Day",
         | 
| 35 | 
            +
                month=1,
         | 
| 36 | 
            +
                day=1,
         | 
| 37 | 
            +
                days_of_week=(MONDAY, TUESDAY, WEDNESDAY, THURSDAY, FRIDAY),
         | 
| 38 | 
            +
            )
         | 
| 39 | 
            +
            # Early May bank holiday
         | 
| 40 | 
            +
            MayBank = Holiday(
         | 
| 41 | 
            +
                "Early May Bank Holiday",
         | 
| 42 | 
            +
                month=5,
         | 
| 43 | 
            +
                day=1,
         | 
| 44 | 
            +
                days_of_week=(MONDAY, TUESDAY, WEDNESDAY, THURSDAY, FRIDAY),
         | 
| 45 | 
            +
            )
         | 
| 46 | 
            +
            # German National Holiday (Tag der Deutschen Einheit)
         | 
| 47 | 
            +
            GermanNationalDay = Holiday(
         | 
| 48 | 
            +
                "Tag der Deutschen Einheit",
         | 
| 49 | 
            +
                month=10,
         | 
| 50 | 
            +
                day=3,
         | 
| 51 | 
            +
                days_of_week=(MONDAY, TUESDAY, WEDNESDAY, THURSDAY, FRIDAY),
         | 
| 52 | 
            +
            )
         | 
| 53 | 
            +
            # Christmas Eve
         | 
| 54 | 
            +
            ChristmasEve = Holiday(
         | 
| 55 | 
            +
                "Christmas Eve",
         | 
| 56 | 
            +
                month=12,
         | 
| 57 | 
            +
                day=24,
         | 
| 58 | 
            +
                observance=previous_friday,
         | 
| 59 | 
            +
            )
         | 
| 60 | 
            +
            # Christmas
         | 
| 61 | 
            +
            Christmas = Holiday(
         | 
| 62 | 
            +
                "Christmas",
         | 
| 63 | 
            +
                month=12,
         | 
| 64 | 
            +
                day=25,
         | 
| 65 | 
            +
                days_of_week=(MONDAY, TUESDAY, WEDNESDAY, THURSDAY, FRIDAY),
         | 
| 66 | 
            +
            )
         | 
| 67 | 
            +
            # If christmas day is Saturday Monday 27th is a holiday
         | 
| 68 | 
            +
            # If christmas day is sunday the Tuesday 27th is a holiday
         | 
| 69 | 
            +
            WeekendChristmas = Holiday(
         | 
| 70 | 
            +
                "Weekend Christmas",
         | 
| 71 | 
            +
                month=12,
         | 
| 72 | 
            +
                day=27,
         | 
| 73 | 
            +
                days_of_week=(MONDAY, TUESDAY),
         | 
| 74 | 
            +
            )
         | 
| 75 | 
            +
            # Boxing day
         | 
| 76 | 
            +
            BoxingDay = Holiday(
         | 
| 77 | 
            +
                "Boxing Day",
         | 
| 78 | 
            +
                month=12,
         | 
| 79 | 
            +
                day=26,
         | 
| 80 | 
            +
            )
         | 
| 81 | 
            +
            # If boxing day is saturday then Monday 28th is a holiday
         | 
| 82 | 
            +
            # If boxing day is sunday then Tuesday 28th is a holiday
         | 
| 83 | 
            +
            WeekendBoxingDay = Holiday(
         | 
| 84 | 
            +
                "Weekend Boxing Day",
         | 
| 85 | 
            +
                month=12,
         | 
| 86 | 
            +
                day=28,
         | 
| 87 | 
            +
                days_of_week=(MONDAY, TUESDAY),
         | 
| 88 | 
            +
            )
         | 
| 89 | 
            +
             | 
| 90 | 
            +
             | 
| 91 | 
            +
            class EUREXExchangeCalendar(MarketCalendar):
         | 
| 92 | 
            +
                """
         | 
| 93 | 
            +
                Exchange calendar for EUREX
         | 
| 94 | 
            +
             | 
| 95 | 
            +
                """
         | 
| 96 | 
            +
             | 
| 97 | 
            +
                aliases = ["EUREX"]
         | 
| 98 | 
            +
                regular_market_times = {
         | 
| 99 | 
            +
                    "market_open": ((None, time(9)),),
         | 
| 100 | 
            +
                    "market_close": ((None, time(17, 30)),),
         | 
| 101 | 
            +
                }
         | 
| 102 | 
            +
             | 
| 103 | 
            +
                @property
         | 
| 104 | 
            +
                def name(self):
         | 
| 105 | 
            +
                    return "EUREX"
         | 
| 106 | 
            +
             | 
| 107 | 
            +
                @property
         | 
| 108 | 
            +
                def tz(self):
         | 
| 109 | 
            +
                    return timezone("Europe/Berlin")
         | 
| 110 | 
            +
             | 
| 111 | 
            +
                @property
         | 
| 112 | 
            +
                def regular_holidays(self):
         | 
| 113 | 
            +
                    return AbstractHolidayCalendar(
         | 
| 114 | 
            +
                        rules=[
         | 
| 115 | 
            +
                            EUREXNewYearsDay,
         | 
| 116 | 
            +
                            GoodFriday,
         | 
| 117 | 
            +
                            EasterMonday,
         | 
| 118 | 
            +
                            MayBank,
         | 
| 119 | 
            +
                            GermanNationalDay,
         | 
| 120 | 
            +
                            Christmas,
         | 
| 121 | 
            +
                            WeekendChristmas,
         | 
| 122 | 
            +
                            BoxingDay,
         | 
| 123 | 
            +
                            WeekendBoxingDay,
         | 
| 124 | 
            +
                        ]
         | 
| 125 | 
            +
                    )
         | 
| 126 | 
            +
             | 
| 127 | 
            +
                @property
         | 
| 128 | 
            +
                def special_closes(self):
         | 
| 129 | 
            +
                    return [
         | 
| 130 | 
            +
                        (
         | 
| 131 | 
            +
                            time(12, 30),
         | 
| 132 | 
            +
                            AbstractHolidayCalendar(
         | 
| 133 | 
            +
                                rules=[
         | 
| 134 | 
            +
                                    ChristmasEve,
         | 
| 135 | 
            +
                                    EUREXNewYearsEve,
         | 
| 136 | 
            +
                                ]
         | 
| 137 | 
            +
                            ),
         | 
| 138 | 
            +
                        )
         | 
| 139 | 
            +
                    ]
         | 
| @@ -0,0 +1,98 @@ | |
| 1 | 
            +
            from datetime import time
         | 
| 2 | 
            +
             | 
| 3 | 
            +
            from pandas.tseries.holiday import (
         | 
| 4 | 
            +
                AbstractHolidayCalendar,
         | 
| 5 | 
            +
                EasterMonday,
         | 
| 6 | 
            +
                GoodFriday,
         | 
| 7 | 
            +
                Holiday,
         | 
| 8 | 
            +
            )
         | 
| 9 | 
            +
            from pytz import timezone
         | 
| 10 | 
            +
             | 
| 11 | 
            +
            from pandas_market_calendars.market_calendar import (
         | 
| 12 | 
            +
                FRIDAY,
         | 
| 13 | 
            +
                MONDAY,
         | 
| 14 | 
            +
                MarketCalendar,
         | 
| 15 | 
            +
                THURSDAY,
         | 
| 16 | 
            +
                TUESDAY,
         | 
| 17 | 
            +
                WEDNESDAY,
         | 
| 18 | 
            +
            )
         | 
| 19 | 
            +
             | 
| 20 | 
            +
            # New Year's Day
         | 
| 21 | 
            +
            EUREXNewYearsDay = Holiday(
         | 
| 22 | 
            +
                "New Year's Day",
         | 
| 23 | 
            +
                month=1,
         | 
| 24 | 
            +
                day=1,
         | 
| 25 | 
            +
                days_of_week=(MONDAY, TUESDAY, WEDNESDAY, THURSDAY, FRIDAY),
         | 
| 26 | 
            +
            )
         | 
| 27 | 
            +
            # Early May bank holiday
         | 
| 28 | 
            +
            MayBank = Holiday(
         | 
| 29 | 
            +
                "Early May Bank Holiday",
         | 
| 30 | 
            +
                month=5,
         | 
| 31 | 
            +
                day=1,
         | 
| 32 | 
            +
                days_of_week=(MONDAY, TUESDAY, WEDNESDAY, THURSDAY, FRIDAY),
         | 
| 33 | 
            +
            )
         | 
| 34 | 
            +
            # Christmas Eve
         | 
| 35 | 
            +
            ChristmasEve = Holiday(
         | 
| 36 | 
            +
                "Christmas Eve",
         | 
| 37 | 
            +
                month=12,
         | 
| 38 | 
            +
                day=24,
         | 
| 39 | 
            +
                days_of_week=(MONDAY, TUESDAY, WEDNESDAY, THURSDAY, FRIDAY),
         | 
| 40 | 
            +
            )
         | 
| 41 | 
            +
            # Christmas
         | 
| 42 | 
            +
            Christmas = Holiday(
         | 
| 43 | 
            +
                "Christmas",
         | 
| 44 | 
            +
                month=12,
         | 
| 45 | 
            +
                day=25,
         | 
| 46 | 
            +
                days_of_week=(MONDAY, TUESDAY, WEDNESDAY, THURSDAY, FRIDAY),
         | 
| 47 | 
            +
            )
         | 
| 48 | 
            +
            # Boxing day
         | 
| 49 | 
            +
            BoxingDay = Holiday(
         | 
| 50 | 
            +
                "Boxing Day",
         | 
| 51 | 
            +
                month=12,
         | 
| 52 | 
            +
                day=26,
         | 
| 53 | 
            +
                days_of_week=(MONDAY, TUESDAY, WEDNESDAY, THURSDAY, FRIDAY),
         | 
| 54 | 
            +
            )
         | 
| 55 | 
            +
            # New Year's Eve
         | 
| 56 | 
            +
            NewYearsEve = Holiday(
         | 
| 57 | 
            +
                "New Year's Eve",
         | 
| 58 | 
            +
                month=12,
         | 
| 59 | 
            +
                day=31,
         | 
| 60 | 
            +
                days_of_week=(MONDAY, TUESDAY, WEDNESDAY, THURSDAY, FRIDAY),
         | 
| 61 | 
            +
            )
         | 
| 62 | 
            +
             | 
| 63 | 
            +
             | 
| 64 | 
            +
            class EUREXFixedIncomeCalendar(MarketCalendar):
         | 
| 65 | 
            +
                """
         | 
| 66 | 
            +
                Trading calendar available here:
         | 
| 67 | 
            +
                https://www.eurex.com/resource/blob/3378814/910cf372738890f691bc1bfbccfd3aef/data/tradingcalendar_2023_en.pdf
         | 
| 68 | 
            +
                """
         | 
| 69 | 
            +
             | 
| 70 | 
            +
                aliases = ["EUREX_Bond"]
         | 
| 71 | 
            +
             | 
| 72 | 
            +
                regular_market_times = {
         | 
| 73 | 
            +
                    "market_open": ((None, time(1, 10)), ("2018-12-10", time(8, 0))),
         | 
| 74 | 
            +
                    "market_close": ((None, time(22)),),
         | 
| 75 | 
            +
                }
         | 
| 76 | 
            +
             | 
| 77 | 
            +
                @property
         | 
| 78 | 
            +
                def name(self):
         | 
| 79 | 
            +
                    return "EUREX_Bond"
         | 
| 80 | 
            +
             | 
| 81 | 
            +
                @property
         | 
| 82 | 
            +
                def tz(self):
         | 
| 83 | 
            +
                    return timezone("Europe/Berlin")
         | 
| 84 | 
            +
             | 
| 85 | 
            +
                @property
         | 
| 86 | 
            +
                def regular_holidays(self):
         | 
| 87 | 
            +
                    return AbstractHolidayCalendar(
         | 
| 88 | 
            +
                        rules=[
         | 
| 89 | 
            +
                            EUREXNewYearsDay,
         | 
| 90 | 
            +
                            GoodFriday,
         | 
| 91 | 
            +
                            EasterMonday,
         | 
| 92 | 
            +
                            MayBank,
         | 
| 93 | 
            +
                            ChristmasEve,
         | 
| 94 | 
            +
                            Christmas,
         | 
| 95 | 
            +
                            BoxingDay,
         | 
| 96 | 
            +
                            NewYearsEve,
         | 
| 97 | 
            +
                        ]
         | 
| 98 | 
            +
                    )
         |