pandas-market-calendars 4.6.0__tar.gz → 4.6.1__tar.gz
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-4.6.0/pandas_market_calendars.egg-info → pandas_market_calendars-4.6.1}/PKG-INFO +2 -2
- {pandas_market_calendars-4.6.0 → pandas_market_calendars-4.6.1}/pandas_market_calendars/calendars/nyse.py +5 -4
- {pandas_market_calendars-4.6.0 → pandas_market_calendars-4.6.1/pandas_market_calendars.egg-info}/PKG-INFO +2 -2
- {pandas_market_calendars-4.6.0 → pandas_market_calendars-4.6.1}/pyproject.toml +2 -2
- {pandas_market_calendars-4.6.0 → pandas_market_calendars-4.6.1}/tests/test_nyse_calendar.py +15 -0
- {pandas_market_calendars-4.6.0 → pandas_market_calendars-4.6.1}/LICENSE +0 -0
- {pandas_market_calendars-4.6.0 → pandas_market_calendars-4.6.1}/NOTICE +0 -0
- {pandas_market_calendars-4.6.0 → pandas_market_calendars-4.6.1}/README.rst +0 -0
- {pandas_market_calendars-4.6.0 → pandas_market_calendars-4.6.1}/pandas_market_calendars/__init__.py +0 -0
- {pandas_market_calendars-4.6.0 → pandas_market_calendars-4.6.1}/pandas_market_calendars/calendar_registry.py +0 -0
- {pandas_market_calendars-4.6.0 → pandas_market_calendars-4.6.1}/pandas_market_calendars/calendar_utils.py +0 -0
- {pandas_market_calendars-4.6.0 → pandas_market_calendars-4.6.1}/pandas_market_calendars/calendars/__init__.py +0 -0
- {pandas_market_calendars-4.6.0 → pandas_market_calendars-4.6.1}/pandas_market_calendars/calendars/asx.py +0 -0
- {pandas_market_calendars-4.6.0 → pandas_market_calendars-4.6.1}/pandas_market_calendars/calendars/bmf.py +0 -0
- {pandas_market_calendars-4.6.0 → pandas_market_calendars-4.6.1}/pandas_market_calendars/calendars/bse.py +0 -0
- {pandas_market_calendars-4.6.0 → pandas_market_calendars-4.6.1}/pandas_market_calendars/calendars/cboe.py +0 -0
- {pandas_market_calendars-4.6.0 → pandas_market_calendars-4.6.1}/pandas_market_calendars/calendars/cme.py +0 -0
- {pandas_market_calendars-4.6.0 → pandas_market_calendars-4.6.1}/pandas_market_calendars/calendars/cme_globex_agriculture.py +0 -0
- {pandas_market_calendars-4.6.0 → pandas_market_calendars-4.6.1}/pandas_market_calendars/calendars/cme_globex_base.py +0 -0
- {pandas_market_calendars-4.6.0 → pandas_market_calendars-4.6.1}/pandas_market_calendars/calendars/cme_globex_crypto.py +0 -0
- {pandas_market_calendars-4.6.0 → pandas_market_calendars-4.6.1}/pandas_market_calendars/calendars/cme_globex_energy_and_metals.py +0 -0
- {pandas_market_calendars-4.6.0 → pandas_market_calendars-4.6.1}/pandas_market_calendars/calendars/cme_globex_equities.py +0 -0
- {pandas_market_calendars-4.6.0 → pandas_market_calendars-4.6.1}/pandas_market_calendars/calendars/cme_globex_fixed_income.py +0 -0
- {pandas_market_calendars-4.6.0 → pandas_market_calendars-4.6.1}/pandas_market_calendars/calendars/cme_globex_fx.py +0 -0
- {pandas_market_calendars-4.6.0 → pandas_market_calendars-4.6.1}/pandas_market_calendars/calendars/eurex.py +0 -0
- {pandas_market_calendars-4.6.0 → pandas_market_calendars-4.6.1}/pandas_market_calendars/calendars/eurex_fixed_income.py +0 -0
- {pandas_market_calendars-4.6.0 → pandas_market_calendars-4.6.1}/pandas_market_calendars/calendars/hkex.py +0 -0
- {pandas_market_calendars-4.6.0 → pandas_market_calendars-4.6.1}/pandas_market_calendars/calendars/ice.py +0 -0
- {pandas_market_calendars-4.6.0 → pandas_market_calendars-4.6.1}/pandas_market_calendars/calendars/iex.py +0 -0
- {pandas_market_calendars-4.6.0 → pandas_market_calendars-4.6.1}/pandas_market_calendars/calendars/jpx.py +0 -0
- {pandas_market_calendars-4.6.0 → pandas_market_calendars-4.6.1}/pandas_market_calendars/calendars/lse.py +0 -0
- {pandas_market_calendars-4.6.0 → pandas_market_calendars-4.6.1}/pandas_market_calendars/calendars/mirror.py +0 -0
- {pandas_market_calendars-4.6.0 → pandas_market_calendars-4.6.1}/pandas_market_calendars/calendars/ose.py +0 -0
- {pandas_market_calendars-4.6.0 → pandas_market_calendars-4.6.1}/pandas_market_calendars/calendars/sifma.py +0 -0
- {pandas_market_calendars-4.6.0 → pandas_market_calendars-4.6.1}/pandas_market_calendars/calendars/six.py +0 -0
- {pandas_market_calendars-4.6.0 → pandas_market_calendars-4.6.1}/pandas_market_calendars/calendars/sse.py +0 -0
- {pandas_market_calendars-4.6.0 → pandas_market_calendars-4.6.1}/pandas_market_calendars/calendars/tase.py +0 -0
- {pandas_market_calendars-4.6.0 → pandas_market_calendars-4.6.1}/pandas_market_calendars/calendars/tsx.py +0 -0
- {pandas_market_calendars-4.6.0 → pandas_market_calendars-4.6.1}/pandas_market_calendars/class_registry.py +0 -0
- {pandas_market_calendars-4.6.0 → pandas_market_calendars-4.6.1}/pandas_market_calendars/holidays/__init__.py +0 -0
- {pandas_market_calendars-4.6.0 → pandas_market_calendars-4.6.1}/pandas_market_calendars/holidays/cme.py +0 -0
- {pandas_market_calendars-4.6.0 → pandas_market_calendars-4.6.1}/pandas_market_calendars/holidays/cme_globex.py +0 -0
- {pandas_market_calendars-4.6.0 → pandas_market_calendars-4.6.1}/pandas_market_calendars/holidays/cn.py +0 -0
- {pandas_market_calendars-4.6.0 → pandas_market_calendars-4.6.1}/pandas_market_calendars/holidays/jp.py +0 -0
- {pandas_market_calendars-4.6.0 → pandas_market_calendars-4.6.1}/pandas_market_calendars/holidays/jpx_equinox.py +0 -0
- {pandas_market_calendars-4.6.0 → pandas_market_calendars-4.6.1}/pandas_market_calendars/holidays/nyse.py +0 -0
- {pandas_market_calendars-4.6.0 → pandas_market_calendars-4.6.1}/pandas_market_calendars/holidays/oz.py +0 -0
- {pandas_market_calendars-4.6.0 → pandas_market_calendars-4.6.1}/pandas_market_calendars/holidays/sifma.py +0 -0
- {pandas_market_calendars-4.6.0 → pandas_market_calendars-4.6.1}/pandas_market_calendars/holidays/uk.py +0 -0
- {pandas_market_calendars-4.6.0 → pandas_market_calendars-4.6.1}/pandas_market_calendars/holidays/us.py +0 -0
- {pandas_market_calendars-4.6.0 → pandas_market_calendars-4.6.1}/pandas_market_calendars/market_calendar.py +0 -0
- {pandas_market_calendars-4.6.0 → pandas_market_calendars-4.6.1}/pandas_market_calendars.egg-info/SOURCES.txt +0 -0
- {pandas_market_calendars-4.6.0 → pandas_market_calendars-4.6.1}/pandas_market_calendars.egg-info/dependency_links.txt +0 -0
- {pandas_market_calendars-4.6.0 → pandas_market_calendars-4.6.1}/pandas_market_calendars.egg-info/requires.txt +0 -0
- {pandas_market_calendars-4.6.0 → pandas_market_calendars-4.6.1}/pandas_market_calendars.egg-info/top_level.txt +0 -0
- {pandas_market_calendars-4.6.0 → pandas_market_calendars-4.6.1}/setup.cfg +0 -0
- {pandas_market_calendars-4.6.0 → pandas_market_calendars-4.6.1}/tests/test_24_7_calendar.py +0 -0
- {pandas_market_calendars-4.6.0 → pandas_market_calendars-4.6.1}/tests/test_XNYS_calendar.py +0 -0
- {pandas_market_calendars-4.6.0 → pandas_market_calendars-4.6.1}/tests/test_asx_calendar.py +0 -0
- {pandas_market_calendars-4.6.0 → pandas_market_calendars-4.6.1}/tests/test_bmf_calendar.py +0 -0
- {pandas_market_calendars-4.6.0 → pandas_market_calendars-4.6.1}/tests/test_bse_calendar.py +0 -0
- {pandas_market_calendars-4.6.0 → pandas_market_calendars-4.6.1}/tests/test_cboe_calendars.py +0 -0
- {pandas_market_calendars-4.6.0 → pandas_market_calendars-4.6.1}/tests/test_class_registry.py +0 -0
- {pandas_market_calendars-4.6.0 → pandas_market_calendars-4.6.1}/tests/test_cme_agriculture_calendar.py +0 -0
- {pandas_market_calendars-4.6.0 → pandas_market_calendars-4.6.1}/tests/test_cme_bond_calendar.py +0 -0
- {pandas_market_calendars-4.6.0 → pandas_market_calendars-4.6.1}/tests/test_cme_equity_calendar.py +0 -0
- {pandas_market_calendars-4.6.0 → pandas_market_calendars-4.6.1}/tests/test_date_range.py +0 -0
- {pandas_market_calendars-4.6.0 → pandas_market_calendars-4.6.1}/tests/test_eurex_calendar.py +0 -0
- {pandas_market_calendars-4.6.0 → pandas_market_calendars-4.6.1}/tests/test_eurex_fixed_income_calendar.py +0 -0
- {pandas_market_calendars-4.6.0 → pandas_market_calendars-4.6.1}/tests/test_exchange_calendar_cme_globex_crypto.py +0 -0
- {pandas_market_calendars-4.6.0 → pandas_market_calendars-4.6.1}/tests/test_exchange_calendar_cme_globex_energy_and_metals.py +0 -0
- {pandas_market_calendars-4.6.0 → pandas_market_calendars-4.6.1}/tests/test_exchange_calendar_cme_globex_equities.py +0 -0
- {pandas_market_calendars-4.6.0 → pandas_market_calendars-4.6.1}/tests/test_exchange_calendar_cme_globex_fixed_income.py +0 -0
- {pandas_market_calendars-4.6.0 → pandas_market_calendars-4.6.1}/tests/test_exchange_calendar_cme_globex_fx.py +0 -0
- {pandas_market_calendars-4.6.0 → pandas_market_calendars-4.6.1}/tests/test_exchange_calendar_cme_globex_grains.py +0 -0
- {pandas_market_calendars-4.6.0 → pandas_market_calendars-4.6.1}/tests/test_hkex_calendar.py +0 -0
- {pandas_market_calendars-4.6.0 → pandas_market_calendars-4.6.1}/tests/test_ice_calendar.py +0 -0
- {pandas_market_calendars-4.6.0 → pandas_market_calendars-4.6.1}/tests/test_iex_calendar.py +0 -0
- {pandas_market_calendars-4.6.0 → pandas_market_calendars-4.6.1}/tests/test_jpx_calendar.py +0 -0
- {pandas_market_calendars-4.6.0 → pandas_market_calendars-4.6.1}/tests/test_lse_calendar.py +0 -0
- {pandas_market_calendars-4.6.0 → pandas_market_calendars-4.6.1}/tests/test_market_calendar.py +0 -0
- {pandas_market_calendars-4.6.0 → pandas_market_calendars-4.6.1}/tests/test_nyse_calendar_early_years.py +0 -0
- {pandas_market_calendars-4.6.0 → pandas_market_calendars-4.6.1}/tests/test_ose_calendar.py +0 -0
- {pandas_market_calendars-4.6.0 → pandas_market_calendars-4.6.1}/tests/test_sifma_calendars.py +0 -0
- {pandas_market_calendars-4.6.0 → pandas_market_calendars-4.6.1}/tests/test_six_calendar.py +0 -0
- {pandas_market_calendars-4.6.0 → pandas_market_calendars-4.6.1}/tests/test_sse_calendar.py +0 -0
- {pandas_market_calendars-4.6.0 → pandas_market_calendars-4.6.1}/tests/test_tsx_calendar.py +0 -0
- {pandas_market_calendars-4.6.0 → pandas_market_calendars-4.6.1}/tests/test_utils.py +0 -0
- {pandas_market_calendars-4.6.0 → pandas_market_calendars-4.6.1}/tests/test_xtae_calendar.py +0 -0
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.2
|
2
2
|
Name: pandas_market_calendars
|
3
|
-
Version: 4.6.
|
3
|
+
Version: 4.6.1
|
4
4
|
Summary: Market and exchange trading calendars for pandas
|
5
5
|
Author-email: Ryan Sheftel <rsheftel@alumni.upenn.edu>
|
6
6
|
License: MIT
|
@@ -19,7 +19,7 @@ Classifier: Programming Language :: Python :: 3.10
|
|
19
19
|
Classifier: Programming Language :: Python :: 3.11
|
20
20
|
Classifier: Programming Language :: Python :: 3.12
|
21
21
|
Classifier: Programming Language :: Python :: 3.13
|
22
|
-
Requires-Python: >=3.
|
22
|
+
Requires-Python: >=3.9
|
23
23
|
Description-Content-Type: text/x-rst
|
24
24
|
License-File: LICENSE
|
25
25
|
License-File: NOTICE
|
@@ -15,15 +15,14 @@
|
|
15
15
|
|
16
16
|
from datetime import time
|
17
17
|
from itertools import chain
|
18
|
+
from typing import Literal, Union
|
18
19
|
|
19
20
|
import pandas as pd
|
20
21
|
from pandas.tseries.holiday import AbstractHolidayCalendar
|
21
22
|
from pandas.tseries.offsets import CustomBusinessDay
|
22
23
|
from pytz import timezone
|
23
24
|
|
24
|
-
from typing import Literal, Union
|
25
25
|
from pandas_market_calendars import calendar_utils as u
|
26
|
-
|
27
26
|
from pandas_market_calendars.holidays.nyse import (
|
28
27
|
# Always Celebrated Holidays
|
29
28
|
USNewYearsDayNYSEpost1952,
|
@@ -1306,8 +1305,10 @@ class NYSEExchangeCalendar(MarketCalendar):
|
|
1306
1305
|
:param tz: time zone in either string or pytz.timezone
|
1307
1306
|
:return: DatetimeIndex of valid business days
|
1308
1307
|
"""
|
1309
|
-
start_date = pd.Timestamp(start_date
|
1310
|
-
end_date = pd.Timestamp(end_date
|
1308
|
+
start_date = pd.Timestamp(start_date)
|
1309
|
+
end_date = pd.Timestamp(end_date)
|
1310
|
+
start_date = start_date.tz_convert(tz) if start_date.tz else start_date.tz_localize(tz)
|
1311
|
+
end_date = end_date.tz_convert(tz) if end_date.tz else end_date.tz_localize(tz)
|
1311
1312
|
|
1312
1313
|
# Starting Monday Sept. 29, 1952, no more saturday trading days
|
1313
1314
|
if tz is None:
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.2
|
2
2
|
Name: pandas_market_calendars
|
3
|
-
Version: 4.6.
|
3
|
+
Version: 4.6.1
|
4
4
|
Summary: Market and exchange trading calendars for pandas
|
5
5
|
Author-email: Ryan Sheftel <rsheftel@alumni.upenn.edu>
|
6
6
|
License: MIT
|
@@ -19,7 +19,7 @@ Classifier: Programming Language :: Python :: 3.10
|
|
19
19
|
Classifier: Programming Language :: Python :: 3.11
|
20
20
|
Classifier: Programming Language :: Python :: 3.12
|
21
21
|
Classifier: Programming Language :: Python :: 3.13
|
22
|
-
Requires-Python: >=3.
|
22
|
+
Requires-Python: >=3.9
|
23
23
|
Description-Content-Type: text/x-rst
|
24
24
|
License-File: LICENSE
|
25
25
|
License-File: NOTICE
|
@@ -1,12 +1,12 @@
|
|
1
1
|
[project]
|
2
2
|
name = "pandas_market_calendars"
|
3
|
-
version = "4.6.
|
3
|
+
version = "4.6.1"
|
4
4
|
authors = [
|
5
5
|
{ name = "Ryan Sheftel", email = "rsheftel@alumni.upenn.edu" },
|
6
6
|
]
|
7
7
|
description = "Market and exchange trading calendars for pandas"
|
8
8
|
readme = "README.rst"
|
9
|
-
requires-python = ">=3.
|
9
|
+
requires-python = ">=3.9"
|
10
10
|
keywords = ["trading", "exchanges", "markets", "OTC", "datetime", "holiday", "business days"]
|
11
11
|
license = { text = "MIT" }
|
12
12
|
classifiers = [
|
@@ -1,5 +1,6 @@
|
|
1
1
|
import datetime as dt
|
2
2
|
import os
|
3
|
+
from zoneinfo import ZoneInfo
|
3
4
|
|
4
5
|
import pandas as pd
|
5
6
|
import pytest
|
@@ -146,6 +147,20 @@ def test_valid_days():
|
|
146
147
|
for tz in ("America/New_York", "Europe/Berlin", None):
|
147
148
|
assert (valid.tz_localize(tz) == cal.valid_days(start, end, tz=tz)).all()
|
148
149
|
|
150
|
+
# test with dates with timezones attached
|
151
|
+
start = pd.Timestamp("2000-01-01", tz="America/New_York")
|
152
|
+
end = pd.Timestamp("2000-01-30", tz="America/New_York")
|
153
|
+
valid_w_tz = cal.valid_days(start, end, tz="UTC").tz_localize(None)
|
154
|
+
assert_index_equal(valid, valid_w_tz)
|
155
|
+
|
156
|
+
|
157
|
+
def test_valid_days_tz_aware():
|
158
|
+
calendar = NYSEExchangeCalendar()
|
159
|
+
data_date = dt.datetime.strptime("20250121", "%Y%m%d").astimezone(ZoneInfo("UTC"))
|
160
|
+
actual = calendar.valid_days(data_date, data_date + dt.timedelta(days=7), tz="UTC")
|
161
|
+
expected = pd.bdate_range("2025-01-21", periods=6, tz="UTC")
|
162
|
+
assert_index_equal(actual, expected)
|
163
|
+
|
149
164
|
|
150
165
|
def test_time_zone():
|
151
166
|
assert NYSEExchangeCalendar().tz == pytz.timezone("America/New_York")
|
File without changes
|
File without changes
|
File without changes
|
{pandas_market_calendars-4.6.0 → pandas_market_calendars-4.6.1}/pandas_market_calendars/__init__.py
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
{pandas_market_calendars-4.6.0 → pandas_market_calendars-4.6.1}/tests/test_cboe_calendars.py
RENAMED
File without changes
|
{pandas_market_calendars-4.6.0 → pandas_market_calendars-4.6.1}/tests/test_class_registry.py
RENAMED
File without changes
|
File without changes
|
{pandas_market_calendars-4.6.0 → pandas_market_calendars-4.6.1}/tests/test_cme_bond_calendar.py
RENAMED
File without changes
|
{pandas_market_calendars-4.6.0 → pandas_market_calendars-4.6.1}/tests/test_cme_equity_calendar.py
RENAMED
File without changes
|
File without changes
|
{pandas_market_calendars-4.6.0 → pandas_market_calendars-4.6.1}/tests/test_eurex_calendar.py
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
{pandas_market_calendars-4.6.0 → pandas_market_calendars-4.6.1}/tests/test_market_calendar.py
RENAMED
File without changes
|
File without changes
|
File without changes
|
{pandas_market_calendars-4.6.0 → pandas_market_calendars-4.6.1}/tests/test_sifma_calendars.py
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|