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.
Files changed (49) hide show
  1. pandas_market_calendars/__init__.py +39 -39
  2. pandas_market_calendars/calendar_registry.py +58 -57
  3. pandas_market_calendars/calendar_utils.py +1151 -1151
  4. pandas_market_calendars/calendars/asx.py +100 -70
  5. pandas_market_calendars/calendars/bmf.py +225 -219
  6. pandas_market_calendars/calendars/bse.py +433 -425
  7. pandas_market_calendars/calendars/cboe.py +153 -149
  8. pandas_market_calendars/calendars/cme.py +417 -405
  9. pandas_market_calendars/calendars/cme_globex_agriculture.py +172 -172
  10. pandas_market_calendars/calendars/cme_globex_base.py +127 -119
  11. pandas_market_calendars/calendars/cme_globex_crypto.py +166 -158
  12. pandas_market_calendars/calendars/cme_globex_energy_and_metals.py +224 -216
  13. pandas_market_calendars/calendars/cme_globex_equities.py +131 -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 +139 -131
  17. pandas_market_calendars/calendars/eurex_fixed_income.py +106 -98
  18. pandas_market_calendars/calendars/hkex.py +437 -431
  19. pandas_market_calendars/calendars/ice.py +89 -81
  20. pandas_market_calendars/calendars/iex.py +163 -155
  21. pandas_market_calendars/calendars/jpx.py +125 -117
  22. pandas_market_calendars/calendars/lse.py +126 -118
  23. pandas_market_calendars/calendars/mirror.py +144 -144
  24. pandas_market_calendars/calendars/nyse.py +1462 -1466
  25. pandas_market_calendars/calendars/ose.py +124 -118
  26. pandas_market_calendars/calendars/sifma.py +391 -383
  27. pandas_market_calendars/calendars/six.py +144 -136
  28. pandas_market_calendars/calendars/sse.py +305 -315
  29. pandas_market_calendars/calendars/tase.py +232 -224
  30. pandas_market_calendars/calendars/tsx.py +193 -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 +82 -63
  39. pandas_market_calendars/holidays/sifma.py +350 -350
  40. pandas_market_calendars/holidays/uk.py +186 -186
  41. pandas_market_calendars/holidays/us.py +376 -376
  42. pandas_market_calendars/market_calendar.py +1006 -1008
  43. {pandas_market_calendars-5.1.0.dist-info → pandas_market_calendars-5.1.3.dist-info}/METADATA +5 -4
  44. pandas_market_calendars-5.1.3.dist-info/RECORD +50 -0
  45. {pandas_market_calendars-5.1.0.dist-info → pandas_market_calendars-5.1.3.dist-info}/WHEEL +1 -1
  46. pandas_market_calendars-5.1.0.dist-info/RECORD +0 -50
  47. {pandas_market_calendars-5.1.0.dist-info → pandas_market_calendars-5.1.3.dist-info}/licenses/LICENSE +0 -0
  48. {pandas_market_calendars-5.1.0.dist-info → pandas_market_calendars-5.1.3.dist-info}/licenses/NOTICE +0 -0
  49. {pandas_market_calendars-5.1.0.dist-info → pandas_market_calendars-5.1.3.dist-info}/top_level.txt +0 -0
@@ -1,117 +1,125 @@
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
+
7
+ # check python versiOn aNd import accordingly
8
+ if sys.version_info >= (3, 9):
9
+ # For Python 3.9 and later, import directly
10
+ from zoneinfo import ZoneInfo
11
+ else:
12
+ # For Python 3.8 and earlier, import from backports
13
+ from backports.zoneinfo import ZoneInfo
14
+
15
+ from pandas_market_calendars.holidays.jp import *
16
+ from pandas_market_calendars.holidays.us import USNewYearsDay
17
+ from pandas_market_calendars.market_calendar import MarketCalendar
18
+
19
+
20
+ # TODO:
21
+ # From 1949 to 1972 the TSE was open on all non-holiday Saturdays for a half day
22
+ # From 1973 to 1984 the TSE was open on all non-holiday Saturdays except the third Saturday of the month
23
+ # need to add support for weekmask to make this work properly
24
+
25
+
26
+ class JPXExchangeCalendar(MarketCalendar):
27
+ """
28
+ Exchange calendar for JPX
29
+
30
+ Open Time: 9:31 AM, Asia/Tokyo
31
+ LUNCH BREAK :facepalm: : 11:30 AM - 12:30 PM Asia/Tokyo
32
+ Close Time: 3:30 PM, Asia/Tokyo
33
+
34
+ Market close of Japan changed from 3:00 PM to 3:30 PM on November 5, 2024
35
+ Reference:
36
+ https://www.jpx.co.jp/english/equities/trading/domestic/tvdivq0000006blj-att/tradinghours_eg.pdf
37
+ """
38
+
39
+ aliases = ["JPX", "XJPX"]
40
+ regular_market_times = {
41
+ "market_open": ((None, time(9)),),
42
+ "market_close": ((None, time(15)), ("2024-11-05", time(15, 30))),
43
+ "break_start": ((None, time(11, 30)),),
44
+ "break_end": ((None, time(12, 30)),),
45
+ }
46
+ regular_early_close = time(13)
47
+
48
+ @property
49
+ def name(self):
50
+ return "JPX"
51
+
52
+ @property
53
+ def full_name(self):
54
+ return "Japan Exchange Group"
55
+
56
+ @property
57
+ def tz(self):
58
+ return ZoneInfo("Asia/Tokyo")
59
+
60
+ @property
61
+ def adhoc_holidays(self):
62
+ return list(
63
+ chain(
64
+ AscensionDays,
65
+ MarriageDays,
66
+ FuneralShowa,
67
+ EnthronementDays,
68
+ AutumnalCitizenDates,
69
+ NoN225IndexPrices,
70
+ EquityTradingSystemFailure,
71
+ )
72
+ )
73
+
74
+ @property
75
+ def regular_holidays(self):
76
+ return AbstractHolidayCalendar(
77
+ rules=[
78
+ USNewYearsDay,
79
+ JapanNewYearsDay2,
80
+ JapanNewYearsDay3,
81
+ JapanComingOfAgeDay1951To1973,
82
+ JapanComingOfAgeDay1974To1999,
83
+ JapanComingOfAgeDay,
84
+ JapanNationalFoundationDay1969To1973,
85
+ JapanNationalFoundationDay,
86
+ JapanEmperorsBirthday,
87
+ JapanVernalEquinox,
88
+ JapanShowaDayUntil1972,
89
+ JapanShowaDay,
90
+ JapanConstitutionMemorialDayUntil1972,
91
+ JapanConstitutionMemorialDay,
92
+ JapanGreeneryDay,
93
+ JapanChildrensDayUntil1972,
94
+ JapanChildrensDay,
95
+ JapanGoldenWeekBonusDay,
96
+ JapanMarineDay1996To2002,
97
+ JapanMarineDay2003To2019,
98
+ JapanMarineDay2020,
99
+ JapanMarineDay2021,
100
+ JapanMarineDay,
101
+ JapanMountainDay2016to2019,
102
+ JapanMountainDay2020,
103
+ JapanMountainDay2021,
104
+ JapanMountainDay2021NextDay,
105
+ JapanMountainDay,
106
+ JapanRespectForTheAgedDay1966To1972,
107
+ JapanRespectForTheAgedDay1973To2002,
108
+ JapanRespectForTheAgedDay,
109
+ JapanAutumnalEquinox,
110
+ JapanHealthAndSportsDay1966To1972,
111
+ JapanHealthAndSportsDay1973To1999,
112
+ JapanHealthAndSportsDay2000To2019,
113
+ JapanSportsDay2020,
114
+ JapanSportsDay2021,
115
+ JapanSportsDay,
116
+ JapanCultureDayUntil1972,
117
+ JapanCultureDay,
118
+ JapanLaborThanksgivingDayUntil1972,
119
+ JapanLaborThanksgivingDay,
120
+ JapanEmperorAkahitosBirthday,
121
+ JapanDecember29Until1988,
122
+ JapanDecember30Until1988,
123
+ JapanBeforeNewYearsDay,
124
+ ]
125
+ )
@@ -1,118 +1,126 @@
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
+
21
+ # check python versiOn aNd import accordingly
22
+ if sys.version_info >= (3, 9):
23
+ # For Python 3.9 and later, import directly
24
+ from zoneinfo import ZoneInfo
25
+ else:
26
+ # For Python 3.8 and earlier, import from backports
27
+ from backports.zoneinfo import ZoneInfo
28
+
29
+ from pandas_market_calendars.holidays.uk import (
30
+ BoxingDay,
31
+ Christmas,
32
+ ChristmasEve,
33
+ LSENewYearsDay,
34
+ LSENewYearsEve,
35
+ MayBank_pre_1995,
36
+ MayBank_post_1995_pre_2020,
37
+ MayBank_post_2020,
38
+ SpringBank_pre_2002,
39
+ SpringBank_post_2002_pre_2012,
40
+ SpringBank_post_2012_pre_2022,
41
+ SpringBank_post_2022,
42
+ SummerBank,
43
+ WeekendBoxingDay,
44
+ WeekendChristmas,
45
+ UniqueCloses,
46
+ )
47
+ from pandas_market_calendars.market_calendar import MarketCalendar
48
+
49
+
50
+ class LSEExchangeCalendar(MarketCalendar):
51
+ """
52
+ Exchange calendar for the London Stock Exchange
53
+
54
+ Open Time: 8:00 AM, GMT
55
+ Close Time: 4:30 PM, GMT
56
+
57
+ Regularly-Observed Holidays:
58
+ - New Years Day (observed on first business day on/after)
59
+ - Good Friday
60
+ - Easter Monday
61
+ - Early May Bank Holiday (first Monday in May)
62
+ - Spring Bank Holiday (last Monday in May)
63
+ - Summer Bank Holiday (last Monday in August)
64
+ - Christmas Day
65
+ - Dec. 27th (if Christmas is on a weekend)
66
+ - Boxing Day
67
+ - Dec. 28th (if Boxing Day is on a weekend)
68
+ """
69
+
70
+ aliases = ["LSE"]
71
+ regular_market_times = {
72
+ "market_open": ((None, time(8)),),
73
+ "market_close": ((None, time(16, 30)),),
74
+ }
75
+
76
+ @property
77
+ def name(self):
78
+ return "LSE"
79
+
80
+ @property
81
+ def full_name(self):
82
+ return "London Stock Exchange"
83
+
84
+ @property
85
+ def tz(self):
86
+ return ZoneInfo("Europe/London")
87
+
88
+ @property
89
+ def regular_holidays(self):
90
+ return AbstractHolidayCalendar(
91
+ rules=[
92
+ LSENewYearsDay,
93
+ GoodFriday,
94
+ EasterMonday,
95
+ MayBank_pre_1995,
96
+ MayBank_post_1995_pre_2020,
97
+ MayBank_post_2020,
98
+ SpringBank_pre_2002,
99
+ SpringBank_post_2002_pre_2012,
100
+ SpringBank_post_2012_pre_2022,
101
+ SpringBank_post_2022,
102
+ SummerBank,
103
+ Christmas,
104
+ WeekendChristmas,
105
+ BoxingDay,
106
+ WeekendBoxingDay,
107
+ ]
108
+ )
109
+
110
+ @property
111
+ def adhoc_holidays(self):
112
+ return UniqueCloses
113
+
114
+ @property
115
+ def special_closes(self):
116
+ return [
117
+ (
118
+ time(12, 30),
119
+ AbstractHolidayCalendar(
120
+ rules=[
121
+ ChristmasEve,
122
+ LSENewYearsEve,
123
+ ]
124
+ ),
125
+ )
126
+ ]