pandas-market-calendars 5.1.0__py3-none-any.whl → 5.1.1__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.
Files changed (48) hide show
  1. pandas_market_calendars/__init__.py +39 -39
  2. pandas_market_calendars/calendar_registry.py +57 -57
  3. pandas_market_calendars/calendar_utils.py +1151 -1151
  4. pandas_market_calendars/calendars/asx.py +77 -70
  5. pandas_market_calendars/calendars/bmf.py +226 -219
  6. pandas_market_calendars/calendars/bse.py +432 -425
  7. pandas_market_calendars/calendars/cboe.py +156 -149
  8. pandas_market_calendars/calendars/cme.py +412 -405
  9. pandas_market_calendars/calendars/cme_globex_agriculture.py +172 -172
  10. pandas_market_calendars/calendars/cme_globex_base.py +126 -119
  11. pandas_market_calendars/calendars/cme_globex_crypto.py +165 -158
  12. pandas_market_calendars/calendars/cme_globex_energy_and_metals.py +223 -216
  13. pandas_market_calendars/calendars/cme_globex_equities.py +130 -123
  14. pandas_market_calendars/calendars/cme_globex_fixed_income.py +136 -136
  15. pandas_market_calendars/calendars/cme_globex_fx.py +101 -101
  16. pandas_market_calendars/calendars/eurex.py +138 -131
  17. pandas_market_calendars/calendars/eurex_fixed_income.py +105 -98
  18. pandas_market_calendars/calendars/hkex.py +438 -431
  19. pandas_market_calendars/calendars/ice.py +88 -81
  20. pandas_market_calendars/calendars/iex.py +162 -155
  21. pandas_market_calendars/calendars/jpx.py +124 -117
  22. pandas_market_calendars/calendars/lse.py +125 -118
  23. pandas_market_calendars/calendars/mirror.py +144 -144
  24. pandas_market_calendars/calendars/nyse.py +1472 -1466
  25. pandas_market_calendars/calendars/ose.py +125 -118
  26. pandas_market_calendars/calendars/sifma.py +390 -383
  27. pandas_market_calendars/calendars/six.py +143 -136
  28. pandas_market_calendars/calendars/sse.py +322 -315
  29. pandas_market_calendars/calendars/tase.py +231 -224
  30. pandas_market_calendars/calendars/tsx.py +192 -185
  31. pandas_market_calendars/class_registry.py +115 -115
  32. pandas_market_calendars/holidays/cme.py +385 -385
  33. pandas_market_calendars/holidays/cme_globex.py +214 -214
  34. pandas_market_calendars/holidays/cn.py +1476 -1476
  35. pandas_market_calendars/holidays/jp.py +401 -401
  36. pandas_market_calendars/holidays/jpx_equinox.py +506 -506
  37. pandas_market_calendars/holidays/nyse.py +1536 -1536
  38. pandas_market_calendars/holidays/oz.py +63 -63
  39. pandas_market_calendars/holidays/sifma.py +350 -350
  40. pandas_market_calendars/holidays/us.py +376 -376
  41. pandas_market_calendars/market_calendar.py +1008 -1008
  42. {pandas_market_calendars-5.1.0.dist-info → pandas_market_calendars-5.1.1.dist-info}/METADATA +3 -1
  43. pandas_market_calendars-5.1.1.dist-info/RECORD +50 -0
  44. {pandas_market_calendars-5.1.0.dist-info → pandas_market_calendars-5.1.1.dist-info}/WHEEL +1 -1
  45. pandas_market_calendars-5.1.0.dist-info/RECORD +0 -50
  46. {pandas_market_calendars-5.1.0.dist-info → pandas_market_calendars-5.1.1.dist-info}/licenses/LICENSE +0 -0
  47. {pandas_market_calendars-5.1.0.dist-info → pandas_market_calendars-5.1.1.dist-info}/licenses/NOTICE +0 -0
  48. {pandas_market_calendars-5.1.0.dist-info → pandas_market_calendars-5.1.1.dist-info}/top_level.txt +0 -0
@@ -1,117 +1,124 @@
1
- from datetime import time
2
- from itertools import chain
3
-
4
- from pandas.tseries.holiday import AbstractHolidayCalendar
5
- from zoneinfo import ZoneInfo
6
-
7
- from pandas_market_calendars.holidays.jp import *
8
- from pandas_market_calendars.holidays.us import USNewYearsDay
9
- from pandas_market_calendars.market_calendar import MarketCalendar
10
-
11
-
12
- # TODO:
13
- # From 1949 to 1972 the TSE was open on all non-holiday Saturdays for a half day
14
- # From 1973 to 1984 the TSE was open on all non-holiday Saturdays except the third Saturday of the month
15
- # need to add support for weekmask to make this work properly
16
-
17
-
18
- class JPXExchangeCalendar(MarketCalendar):
19
- """
20
- Exchange calendar for JPX
21
-
22
- Open Time: 9:31 AM, Asia/Tokyo
23
- LUNCH BREAK :facepalm: : 11:30 AM - 12:30 PM Asia/Tokyo
24
- Close Time: 3:30 PM, Asia/Tokyo
25
-
26
- Market close of Japan changed from 3:00 PM to 3:30 PM on November 5, 2024
27
- Reference:
28
- https://www.jpx.co.jp/english/equities/trading/domestic/tvdivq0000006blj-att/tradinghours_eg.pdf
29
- """
30
-
31
- aliases = ["JPX", "XJPX"]
32
- regular_market_times = {
33
- "market_open": ((None, time(9)),),
34
- "market_close": ((None, time(15)), ("2024-11-05", time(15, 30))),
35
- "break_start": ((None, time(11, 30)),),
36
- "break_end": ((None, time(12, 30)),),
37
- }
38
- regular_early_close = time(13)
39
-
40
- @property
41
- def name(self):
42
- return "JPX"
43
-
44
- @property
45
- def full_name(self):
46
- return "Japan Exchange Group"
47
-
48
- @property
49
- def tz(self):
50
- return ZoneInfo("Asia/Tokyo")
51
-
52
- @property
53
- def adhoc_holidays(self):
54
- return list(
55
- chain(
56
- AscensionDays,
57
- MarriageDays,
58
- FuneralShowa,
59
- EnthronementDays,
60
- AutumnalCitizenDates,
61
- NoN225IndexPrices,
62
- EquityTradingSystemFailure,
63
- )
64
- )
65
-
66
- @property
67
- def regular_holidays(self):
68
- return AbstractHolidayCalendar(
69
- rules=[
70
- USNewYearsDay,
71
- JapanNewYearsDay2,
72
- JapanNewYearsDay3,
73
- JapanComingOfAgeDay1951To1973,
74
- JapanComingOfAgeDay1974To1999,
75
- JapanComingOfAgeDay,
76
- JapanNationalFoundationDay1969To1973,
77
- JapanNationalFoundationDay,
78
- JapanEmperorsBirthday,
79
- JapanVernalEquinox,
80
- JapanShowaDayUntil1972,
81
- JapanShowaDay,
82
- JapanConstitutionMemorialDayUntil1972,
83
- JapanConstitutionMemorialDay,
84
- JapanGreeneryDay,
85
- JapanChildrensDayUntil1972,
86
- JapanChildrensDay,
87
- JapanGoldenWeekBonusDay,
88
- JapanMarineDay1996To2002,
89
- JapanMarineDay2003To2019,
90
- JapanMarineDay2020,
91
- JapanMarineDay2021,
92
- JapanMarineDay,
93
- JapanMountainDay2016to2019,
94
- JapanMountainDay2020,
95
- JapanMountainDay2021,
96
- JapanMountainDay2021NextDay,
97
- JapanMountainDay,
98
- JapanRespectForTheAgedDay1966To1972,
99
- JapanRespectForTheAgedDay1973To2002,
100
- JapanRespectForTheAgedDay,
101
- JapanAutumnalEquinox,
102
- JapanHealthAndSportsDay1966To1972,
103
- JapanHealthAndSportsDay1973To1999,
104
- JapanHealthAndSportsDay2000To2019,
105
- JapanSportsDay2020,
106
- JapanSportsDay2021,
107
- JapanSportsDay,
108
- JapanCultureDayUntil1972,
109
- JapanCultureDay,
110
- JapanLaborThanksgivingDayUntil1972,
111
- JapanLaborThanksgivingDay,
112
- JapanEmperorAkahitosBirthday,
113
- JapanDecember29Until1988,
114
- JapanDecember30Until1988,
115
- JapanBeforeNewYearsDay,
116
- ]
117
- )
1
+ from datetime import time
2
+ from itertools import chain
3
+
4
+ from pandas.tseries.holiday import AbstractHolidayCalendar
5
+ import sys
6
+ # check python versiOn aNd import accordingly
7
+ if sys.version_info >= (3, 9):
8
+ # For Python 3.9 and later, import directly
9
+ from zoneinfo import ZoneInfo
10
+ else:
11
+ # For Python 3.8 and earlier, import from backports
12
+ from backports.zoneinfo import ZoneInfo
13
+
14
+ from pandas_market_calendars.holidays.jp import *
15
+ from pandas_market_calendars.holidays.us import USNewYearsDay
16
+ from pandas_market_calendars.market_calendar import MarketCalendar
17
+
18
+
19
+ # TODO:
20
+ # From 1949 to 1972 the TSE was open on all non-holiday Saturdays for a half day
21
+ # From 1973 to 1984 the TSE was open on all non-holiday Saturdays except the third Saturday of the month
22
+ # need to add support for weekmask to make this work properly
23
+
24
+
25
+ class JPXExchangeCalendar(MarketCalendar):
26
+ """
27
+ Exchange calendar for JPX
28
+
29
+ Open Time: 9:31 AM, Asia/Tokyo
30
+ LUNCH BREAK :facepalm: : 11:30 AM - 12:30 PM Asia/Tokyo
31
+ Close Time: 3:30 PM, Asia/Tokyo
32
+
33
+ Market close of Japan changed from 3:00 PM to 3:30 PM on November 5, 2024
34
+ Reference:
35
+ https://www.jpx.co.jp/english/equities/trading/domestic/tvdivq0000006blj-att/tradinghours_eg.pdf
36
+ """
37
+
38
+ aliases = ["JPX", "XJPX"]
39
+ regular_market_times = {
40
+ "market_open": ((None, time(9)),),
41
+ "market_close": ((None, time(15)), ("2024-11-05", time(15, 30))),
42
+ "break_start": ((None, time(11, 30)),),
43
+ "break_end": ((None, time(12, 30)),),
44
+ }
45
+ regular_early_close = time(13)
46
+
47
+ @property
48
+ def name(self):
49
+ return "JPX"
50
+
51
+ @property
52
+ def full_name(self):
53
+ return "Japan Exchange Group"
54
+
55
+ @property
56
+ def tz(self):
57
+ return ZoneInfo("Asia/Tokyo")
58
+
59
+ @property
60
+ def adhoc_holidays(self):
61
+ return list(
62
+ chain(
63
+ AscensionDays,
64
+ MarriageDays,
65
+ FuneralShowa,
66
+ EnthronementDays,
67
+ AutumnalCitizenDates,
68
+ NoN225IndexPrices,
69
+ EquityTradingSystemFailure,
70
+ )
71
+ )
72
+
73
+ @property
74
+ def regular_holidays(self):
75
+ return AbstractHolidayCalendar(
76
+ rules=[
77
+ USNewYearsDay,
78
+ JapanNewYearsDay2,
79
+ JapanNewYearsDay3,
80
+ JapanComingOfAgeDay1951To1973,
81
+ JapanComingOfAgeDay1974To1999,
82
+ JapanComingOfAgeDay,
83
+ JapanNationalFoundationDay1969To1973,
84
+ JapanNationalFoundationDay,
85
+ JapanEmperorsBirthday,
86
+ JapanVernalEquinox,
87
+ JapanShowaDayUntil1972,
88
+ JapanShowaDay,
89
+ JapanConstitutionMemorialDayUntil1972,
90
+ JapanConstitutionMemorialDay,
91
+ JapanGreeneryDay,
92
+ JapanChildrensDayUntil1972,
93
+ JapanChildrensDay,
94
+ JapanGoldenWeekBonusDay,
95
+ JapanMarineDay1996To2002,
96
+ JapanMarineDay2003To2019,
97
+ JapanMarineDay2020,
98
+ JapanMarineDay2021,
99
+ JapanMarineDay,
100
+ JapanMountainDay2016to2019,
101
+ JapanMountainDay2020,
102
+ JapanMountainDay2021,
103
+ JapanMountainDay2021NextDay,
104
+ JapanMountainDay,
105
+ JapanRespectForTheAgedDay1966To1972,
106
+ JapanRespectForTheAgedDay1973To2002,
107
+ JapanRespectForTheAgedDay,
108
+ JapanAutumnalEquinox,
109
+ JapanHealthAndSportsDay1966To1972,
110
+ JapanHealthAndSportsDay1973To1999,
111
+ JapanHealthAndSportsDay2000To2019,
112
+ JapanSportsDay2020,
113
+ JapanSportsDay2021,
114
+ JapanSportsDay,
115
+ JapanCultureDayUntil1972,
116
+ JapanCultureDay,
117
+ JapanLaborThanksgivingDayUntil1972,
118
+ JapanLaborThanksgivingDay,
119
+ JapanEmperorAkahitosBirthday,
120
+ JapanDecember29Until1988,
121
+ JapanDecember30Until1988,
122
+ JapanBeforeNewYearsDay,
123
+ ]
124
+ )
@@ -1,118 +1,125 @@
1
- #
2
- # Copyright 2016 Quantopian, Inc.
3
- #
4
- # Licensed under the Apache License, Version 2.0 (the "License");
5
- # you may not use this file except in compliance with the License.
6
- # You may obtain a copy of the License at
7
- #
8
- # http://www.apache.org/licenses/LICENSE-2.0
9
- #
10
- # Unless required by applicable law or agreed to in writing, software
11
- # distributed under the License is distributed on an "AS IS" BASIS,
12
- # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
- # See the License for the specific language governing permissions and
14
- # limitations under the License.
15
-
16
- from datetime import time
17
-
18
- from pandas.tseries.holiday import AbstractHolidayCalendar, EasterMonday, GoodFriday
19
- from zoneinfo import ZoneInfo
20
-
21
- from pandas_market_calendars.holidays.uk import (
22
- BoxingDay,
23
- Christmas,
24
- ChristmasEve,
25
- LSENewYearsDay,
26
- LSENewYearsEve,
27
- MayBank_pre_1995,
28
- MayBank_post_1995_pre_2020,
29
- MayBank_post_2020,
30
- SpringBank_pre_2002,
31
- SpringBank_post_2002_pre_2012,
32
- SpringBank_post_2012_pre_2022,
33
- SpringBank_post_2022,
34
- SummerBank,
35
- WeekendBoxingDay,
36
- WeekendChristmas,
37
- UniqueCloses,
38
- )
39
- from pandas_market_calendars.market_calendar import MarketCalendar
40
-
41
-
42
- class LSEExchangeCalendar(MarketCalendar):
43
- """
44
- Exchange calendar for the London Stock Exchange
45
-
46
- Open Time: 8:00 AM, GMT
47
- Close Time: 4:30 PM, GMT
48
-
49
- Regularly-Observed Holidays:
50
- - New Years Day (observed on first business day on/after)
51
- - Good Friday
52
- - Easter Monday
53
- - Early May Bank Holiday (first Monday in May)
54
- - Spring Bank Holiday (last Monday in May)
55
- - Summer Bank Holiday (last Monday in August)
56
- - Christmas Day
57
- - Dec. 27th (if Christmas is on a weekend)
58
- - Boxing Day
59
- - Dec. 28th (if Boxing Day is on a weekend)
60
- """
61
-
62
- aliases = ["LSE"]
63
- regular_market_times = {
64
- "market_open": ((None, time(8)),),
65
- "market_close": ((None, time(16, 30)),),
66
- }
67
-
68
- @property
69
- def name(self):
70
- return "LSE"
71
-
72
- @property
73
- def full_name(self):
74
- return "London Stock Exchange"
75
-
76
- @property
77
- def tz(self):
78
- return ZoneInfo("Europe/London")
79
-
80
- @property
81
- def regular_holidays(self):
82
- return AbstractHolidayCalendar(
83
- rules=[
84
- LSENewYearsDay,
85
- GoodFriday,
86
- EasterMonday,
87
- MayBank_pre_1995,
88
- MayBank_post_1995_pre_2020,
89
- MayBank_post_2020,
90
- SpringBank_pre_2002,
91
- SpringBank_post_2002_pre_2012,
92
- SpringBank_post_2012_pre_2022,
93
- SpringBank_post_2022,
94
- SummerBank,
95
- Christmas,
96
- WeekendChristmas,
97
- BoxingDay,
98
- WeekendBoxingDay,
99
- ]
100
- )
101
-
102
- @property
103
- def adhoc_holidays(self):
104
- return UniqueCloses
105
-
106
- @property
107
- def special_closes(self):
108
- return [
109
- (
110
- time(12, 30),
111
- AbstractHolidayCalendar(
112
- rules=[
113
- ChristmasEve,
114
- LSENewYearsEve,
115
- ]
116
- ),
117
- )
118
- ]
1
+ #
2
+ # Copyright 2016 Quantopian, Inc.
3
+ #
4
+ # Licensed under the Apache License, Version 2.0 (the "License");
5
+ # you may not use this file except in compliance with the License.
6
+ # You may obtain a copy of the License at
7
+ #
8
+ # http://www.apache.org/licenses/LICENSE-2.0
9
+ #
10
+ # Unless required by applicable law or agreed to in writing, software
11
+ # distributed under the License is distributed on an "AS IS" BASIS,
12
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ # See the License for the specific language governing permissions and
14
+ # limitations under the License.
15
+
16
+ from datetime import time
17
+
18
+ from pandas.tseries.holiday import AbstractHolidayCalendar, EasterMonday, GoodFriday
19
+ import sys
20
+ # check python versiOn aNd import accordingly
21
+ if sys.version_info >= (3, 9):
22
+ # For Python 3.9 and later, import directly
23
+ from zoneinfo import ZoneInfo
24
+ else:
25
+ # For Python 3.8 and earlier, import from backports
26
+ from backports.zoneinfo import ZoneInfo
27
+
28
+ from pandas_market_calendars.holidays.uk import (
29
+ BoxingDay,
30
+ Christmas,
31
+ ChristmasEve,
32
+ LSENewYearsDay,
33
+ LSENewYearsEve,
34
+ MayBank_pre_1995,
35
+ MayBank_post_1995_pre_2020,
36
+ MayBank_post_2020,
37
+ SpringBank_pre_2002,
38
+ SpringBank_post_2002_pre_2012,
39
+ SpringBank_post_2012_pre_2022,
40
+ SpringBank_post_2022,
41
+ SummerBank,
42
+ WeekendBoxingDay,
43
+ WeekendChristmas,
44
+ UniqueCloses,
45
+ )
46
+ from pandas_market_calendars.market_calendar import MarketCalendar
47
+
48
+
49
+ class LSEExchangeCalendar(MarketCalendar):
50
+ """
51
+ Exchange calendar for the London Stock Exchange
52
+
53
+ Open Time: 8:00 AM, GMT
54
+ Close Time: 4:30 PM, GMT
55
+
56
+ Regularly-Observed Holidays:
57
+ - New Years Day (observed on first business day on/after)
58
+ - Good Friday
59
+ - Easter Monday
60
+ - Early May Bank Holiday (first Monday in May)
61
+ - Spring Bank Holiday (last Monday in May)
62
+ - Summer Bank Holiday (last Monday in August)
63
+ - Christmas Day
64
+ - Dec. 27th (if Christmas is on a weekend)
65
+ - Boxing Day
66
+ - Dec. 28th (if Boxing Day is on a weekend)
67
+ """
68
+
69
+ aliases = ["LSE"]
70
+ regular_market_times = {
71
+ "market_open": ((None, time(8)),),
72
+ "market_close": ((None, time(16, 30)),),
73
+ }
74
+
75
+ @property
76
+ def name(self):
77
+ return "LSE"
78
+
79
+ @property
80
+ def full_name(self):
81
+ return "London Stock Exchange"
82
+
83
+ @property
84
+ def tz(self):
85
+ return ZoneInfo("Europe/London")
86
+
87
+ @property
88
+ def regular_holidays(self):
89
+ return AbstractHolidayCalendar(
90
+ rules=[
91
+ LSENewYearsDay,
92
+ GoodFriday,
93
+ EasterMonday,
94
+ MayBank_pre_1995,
95
+ MayBank_post_1995_pre_2020,
96
+ MayBank_post_2020,
97
+ SpringBank_pre_2002,
98
+ SpringBank_post_2002_pre_2012,
99
+ SpringBank_post_2012_pre_2022,
100
+ SpringBank_post_2022,
101
+ SummerBank,
102
+ Christmas,
103
+ WeekendChristmas,
104
+ BoxingDay,
105
+ WeekendBoxingDay,
106
+ ]
107
+ )
108
+
109
+ @property
110
+ def adhoc_holidays(self):
111
+ return UniqueCloses
112
+
113
+ @property
114
+ def special_closes(self):
115
+ return [
116
+ (
117
+ time(12, 30),
118
+ AbstractHolidayCalendar(
119
+ rules=[
120
+ ChristmasEve,
121
+ LSENewYearsEve,
122
+ ]
123
+ ),
124
+ )
125
+ ]