cryptodatapy 0.2.33__tar.gz → 0.2.34__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.
Files changed (64) hide show
  1. {cryptodatapy-0.2.33 → cryptodatapy-0.2.34}/PKG-INFO +1 -1
  2. {cryptodatapy-0.2.33 → cryptodatapy-0.2.34}/pyproject.toml +1 -1
  3. {cryptodatapy-0.2.33 → cryptodatapy-0.2.34}/src/cryptodatapy/conf/fields.csv +1 -1
  4. {cryptodatapy-0.2.33 → cryptodatapy-0.2.34}/src/cryptodatapy/extract/libraries/ccxt_api.py +38 -1
  5. {cryptodatapy-0.2.33 → cryptodatapy-0.2.34}/src/cryptodatapy/transform/wrangle.py +2 -5
  6. {cryptodatapy-0.2.33 → cryptodatapy-0.2.34}/LICENSE +0 -0
  7. {cryptodatapy-0.2.33 → cryptodatapy-0.2.34}/README.md +0 -0
  8. {cryptodatapy-0.2.33 → cryptodatapy-0.2.34}/src/cryptodatapy/__init__.py +0 -0
  9. {cryptodatapy-0.2.33 → cryptodatapy-0.2.34}/src/cryptodatapy/conf/__init__.py +0 -0
  10. {cryptodatapy-0.2.33 → cryptodatapy-0.2.34}/src/cryptodatapy/conf/tickers.csv +0 -0
  11. {cryptodatapy-0.2.33 → cryptodatapy-0.2.34}/src/cryptodatapy/datasets/__init__.py +0 -0
  12. {cryptodatapy-0.2.33 → cryptodatapy-0.2.34}/src/cryptodatapy/datasets/br_econ_calendar.csv +0 -0
  13. {cryptodatapy-0.2.33 → cryptodatapy-0.2.34}/src/cryptodatapy/datasets/ca_econ_calendar.csv +0 -0
  14. {cryptodatapy-0.2.33 → cryptodatapy-0.2.34}/src/cryptodatapy/datasets/cn_econ_calendar.csv +0 -0
  15. {cryptodatapy-0.2.33 → cryptodatapy-0.2.34}/src/cryptodatapy/datasets/de_econ_calendar.csv +0 -0
  16. {cryptodatapy-0.2.33 → cryptodatapy-0.2.34}/src/cryptodatapy/datasets/ez_econ_calendar.csv +0 -0
  17. {cryptodatapy-0.2.33 → cryptodatapy-0.2.34}/src/cryptodatapy/datasets/fr_econ_calendar.csv +0 -0
  18. {cryptodatapy-0.2.33 → cryptodatapy-0.2.34}/src/cryptodatapy/datasets/gb_econ_calendar.csv +0 -0
  19. {cryptodatapy-0.2.33 → cryptodatapy-0.2.34}/src/cryptodatapy/datasets/get_econ_calendars.py +0 -0
  20. {cryptodatapy-0.2.33 → cryptodatapy-0.2.34}/src/cryptodatapy/datasets/id_econ_calendar.csv +0 -0
  21. {cryptodatapy-0.2.33 → cryptodatapy-0.2.34}/src/cryptodatapy/datasets/in_econ_calendar.csv +0 -0
  22. {cryptodatapy-0.2.33 → cryptodatapy-0.2.34}/src/cryptodatapy/datasets/it_econ_calendar.csv +0 -0
  23. {cryptodatapy-0.2.33 → cryptodatapy-0.2.34}/src/cryptodatapy/datasets/jp_econ_calendar.csv +0 -0
  24. {cryptodatapy-0.2.33 → cryptodatapy-0.2.34}/src/cryptodatapy/datasets/kr_econ_calendar.csv +0 -0
  25. {cryptodatapy-0.2.33 → cryptodatapy-0.2.34}/src/cryptodatapy/datasets/mx_econ_calendar.csv +0 -0
  26. {cryptodatapy-0.2.33 → cryptodatapy-0.2.34}/src/cryptodatapy/datasets/ru_econ_calendar.csv +0 -0
  27. {cryptodatapy-0.2.33 → cryptodatapy-0.2.34}/src/cryptodatapy/datasets/tr_econ_calendar.csv +0 -0
  28. {cryptodatapy-0.2.33 → cryptodatapy-0.2.34}/src/cryptodatapy/datasets/us_econ_calendar.csv +0 -0
  29. {cryptodatapy-0.2.33 → cryptodatapy-0.2.34}/src/cryptodatapy/extract/__init__.py +0 -0
  30. {cryptodatapy-0.2.33 → cryptodatapy-0.2.34}/src/cryptodatapy/extract/data_vendors/.ipynb_checkpoints/CCXT-checkpoint.ipynb +0 -0
  31. {cryptodatapy-0.2.33 → cryptodatapy-0.2.34}/src/cryptodatapy/extract/data_vendors/.ipynb_checkpoints/DBNomics-checkpoint.ipynb +0 -0
  32. {cryptodatapy-0.2.33 → cryptodatapy-0.2.34}/src/cryptodatapy/extract/data_vendors/.ipynb_checkpoints/InvestPy-checkpoint.ipynb +0 -0
  33. {cryptodatapy-0.2.33 → cryptodatapy-0.2.34}/src/cryptodatapy/extract/data_vendors/.ipynb_checkpoints/NasdaqDataLink-checkpoint.ipynb +0 -0
  34. {cryptodatapy-0.2.33 → cryptodatapy-0.2.34}/src/cryptodatapy/extract/data_vendors/.ipynb_checkpoints/PandasDataReader-checkpoint.ipynb +0 -0
  35. {cryptodatapy-0.2.33 → cryptodatapy-0.2.34}/src/cryptodatapy/extract/data_vendors/__init__.py +0 -0
  36. {cryptodatapy-0.2.33 → cryptodatapy-0.2.34}/src/cryptodatapy/extract/data_vendors/coinmetrics_api.py +0 -0
  37. {cryptodatapy-0.2.33 → cryptodatapy-0.2.34}/src/cryptodatapy/extract/data_vendors/cryptocompare_api.py +0 -0
  38. {cryptodatapy-0.2.33 → cryptodatapy-0.2.34}/src/cryptodatapy/extract/data_vendors/datavendor.py +0 -0
  39. {cryptodatapy-0.2.33 → cryptodatapy-0.2.34}/src/cryptodatapy/extract/data_vendors/glassnode_api.py +0 -0
  40. {cryptodatapy-0.2.33 → cryptodatapy-0.2.34}/src/cryptodatapy/extract/data_vendors/polygon_api.py +0 -0
  41. {cryptodatapy-0.2.33 → cryptodatapy-0.2.34}/src/cryptodatapy/extract/data_vendors/tiingo_api.py +0 -0
  42. {cryptodatapy-0.2.33 → cryptodatapy-0.2.34}/src/cryptodatapy/extract/datarequest.py +0 -0
  43. {cryptodatapy-0.2.33 → cryptodatapy-0.2.34}/src/cryptodatapy/extract/exchanges/__init__.py +0 -0
  44. {cryptodatapy-0.2.33 → cryptodatapy-0.2.34}/src/cryptodatapy/extract/exchanges/dydx.py +0 -0
  45. {cryptodatapy-0.2.33 → cryptodatapy-0.2.34}/src/cryptodatapy/extract/exchanges/exchange.py +0 -0
  46. {cryptodatapy-0.2.33 → cryptodatapy-0.2.34}/src/cryptodatapy/extract/getdata.py +0 -0
  47. {cryptodatapy-0.2.33 → cryptodatapy-0.2.34}/src/cryptodatapy/extract/libraries/__init__.py +0 -0
  48. {cryptodatapy-0.2.33 → cryptodatapy-0.2.34}/src/cryptodatapy/extract/libraries/dbnomics_api.py +0 -0
  49. {cryptodatapy-0.2.33 → cryptodatapy-0.2.34}/src/cryptodatapy/extract/libraries/investpy_api.py +0 -0
  50. {cryptodatapy-0.2.33 → cryptodatapy-0.2.34}/src/cryptodatapy/extract/libraries/library.py +0 -0
  51. {cryptodatapy-0.2.33 → cryptodatapy-0.2.34}/src/cryptodatapy/extract/libraries/pandasdr_api.py +0 -0
  52. {cryptodatapy-0.2.33 → cryptodatapy-0.2.34}/src/cryptodatapy/extract/web/__init__.py +0 -0
  53. {cryptodatapy-0.2.33 → cryptodatapy-0.2.34}/src/cryptodatapy/extract/web/aqr.py +0 -0
  54. {cryptodatapy-0.2.33 → cryptodatapy-0.2.34}/src/cryptodatapy/extract/web/web.py +0 -0
  55. {cryptodatapy-0.2.33 → cryptodatapy-0.2.34}/src/cryptodatapy/transform/__init__.py +0 -0
  56. {cryptodatapy-0.2.33 → cryptodatapy-0.2.34}/src/cryptodatapy/transform/clean.py +0 -0
  57. {cryptodatapy-0.2.33 → cryptodatapy-0.2.34}/src/cryptodatapy/transform/convertparams.py +0 -0
  58. {cryptodatapy-0.2.33 → cryptodatapy-0.2.34}/src/cryptodatapy/transform/filter.py +0 -0
  59. {cryptodatapy-0.2.33 → cryptodatapy-0.2.34}/src/cryptodatapy/transform/impute.py +0 -0
  60. {cryptodatapy-0.2.33 → cryptodatapy-0.2.34}/src/cryptodatapy/transform/od.py +0 -0
  61. {cryptodatapy-0.2.33 → cryptodatapy-0.2.34}/src/cryptodatapy/util/__init__.py +0 -0
  62. {cryptodatapy-0.2.33 → cryptodatapy-0.2.34}/src/cryptodatapy/util/datacatalog.py +0 -0
  63. {cryptodatapy-0.2.33 → cryptodatapy-0.2.34}/src/cryptodatapy/util/datacredentials.py +0 -0
  64. {cryptodatapy-0.2.33 → cryptodatapy-0.2.34}/src/cryptodatapy/util/utils.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: cryptodatapy
3
- Version: 0.2.33
3
+ Version: 0.2.34
4
4
  Summary: Cryptoasset data library
5
5
  License: Apache-2.0
6
6
  Author: Systamental
@@ -1,6 +1,6 @@
1
1
  [tool.poetry]
2
2
  name = "cryptodatapy"
3
- version = "0.2.33"
3
+ version = "0.2.34"
4
4
  description = "Cryptoasset data library"
5
5
  authors = ["Systamental"]
6
6
  license = "Apache License 2.0"
@@ -27,7 +27,7 @@ vwap,volume-weighted avg price,average volume-weighted price of quote asset with
27
27
  dividend,dividend,dividend paid out on ex-ante date,market,ohlc_bars,d,quote currency units,Float64,,,,,,divCash,,,,,,,,
28
28
  split,split,"factor used to adjust prices when a company splits, reverse splits, or pays a distribution",market,ohlc_bars,d,factor,Float64,,,,,,splitFactor,,,,,,,,
29
29
  ref_rate_usd,reference rate in USD,price of asset in USD using an aggregation methodology,market,ohlc_bars,d,quote currency units,Float64,,ReferenceRateUSD,,,,,,,,,,,,
30
- oi,open interest,number of outstanding futures contracts that are open and have yet to be settled,market,derivatives,"1min, 5min, 10min, 15min, 30min, 1h, 2h, 4h, 8h, d, w, m, q",number of contracts,Float64,,contract_count,,,,,,,,,,,,
30
+ oi,open interest,number of outstanding futures contracts that are open and have yet to be settled,market,derivatives,"1min, 5min, 10min, 15min, 30min, 1h, 2h, 4h, 8h, d, w, m, q",number of contracts,Float64,,contract_count,openInterestAmount,,,,,,,,,,,
31
31
  funding_rate,funding rate,interest rate for holding derivative contract within time interval,market,derivatives,"1h, 2h, 4h, 8h, d, w, m, q",interest rate over time interval,Float64,,rate,fundingRate,derivatives/futures_funding_rate_perpetual,,,,,,,,,,
32
32
  mkt_cap,market capitalization,usd value of circulating supply,market,market capitalization,"d, w, m, q",usd,Float64,,CapMrktCurUSD,,market/marketcap_usd,,,,,,,,,,
33
33
  mkt_cap_real,"market capitalization, reaized","The sum USD value based on the USD closing price on the day that a native unit last moved (i.e., last transacted) for all native units",market,market capitalization,"d, w, m, q",usd,Float64,,CapRealUSD,,,,,,,,,,,,
@@ -1042,6 +1042,26 @@ class CCXT(Library):
1042
1042
  attempts = 0
1043
1043
  data_resp = []
1044
1044
 
1045
+ # Maximum historical range for Binance OI is 30 days
1046
+ # 30 days in milliseconds: 30 * 24 * 60 * 60 * 1000 = 2,592,000,000 ms
1047
+ SAFE_OI_RANGE_MS = 25 * 24 * 60 * 60 * 1000
1048
+
1049
+ # inst exch
1050
+ if self.exchange_async is None:
1051
+ self.exchange_async = getattr(ccxt_async, exch)()
1052
+
1053
+ # --- Binance 30-day Limit Enforcement ---
1054
+ if exch.lower() == 'binanceusdm': # Binance USDM Futures
1055
+ requested_range_ms = end_date - start_date
1056
+ if requested_range_ms > SAFE_OI_RANGE_MS:
1057
+ # Adjust start_date to fit within the 30-day window ending at end_date
1058
+ new_start_date = end_date - SAFE_OI_RANGE_MS
1059
+ logging.warning(
1060
+ f"Exchange '{exch}' Open Interest historical data is limited to 30 days. "
1061
+ f"Adjusting start_date for {ticker} from {start_date} to {new_start_date}."
1062
+ )
1063
+ start_date = new_start_date
1064
+
1045
1065
  # inst exch
1046
1066
  if self.exchange_async is None:
1047
1067
  self.exchange_async = getattr(ccxt_async, exch)()
@@ -1124,8 +1144,25 @@ class CCXT(Library):
1124
1144
  attempts = 0
1125
1145
  data_resp = []
1126
1146
 
1147
+ # Maximum historical range for Binance OI is 30 days
1148
+ # 30 days in milliseconds: 30 * 24 * 60 * 60 * 1000 = 2,592,000,000 ms
1149
+ SAFE_OI_RANGE_MS = 25 * 24 * 60 * 60 * 1000
1150
+
1127
1151
  # inst exch
1128
- self.exchange = getattr(ccxt, exch)()
1152
+ if self.exchange_async is None:
1153
+ self.exchange_async = getattr(ccxt_async, exch)()
1154
+
1155
+ # --- Binance 30-day Limit Enforcement ---
1156
+ if exch.lower() == 'binanceusdm': # Binance USDM Futures
1157
+ requested_range_ms = end_date - start_date
1158
+ if requested_range_ms > SAFE_OI_RANGE_MS:
1159
+ # Adjust start_date to fit within the 30-day window ending at end_date
1160
+ new_start_date = end_date - SAFE_OI_RANGE_MS
1161
+ logging.warning(
1162
+ f"Exchange '{exch}' open interest historical data is limited to 30 days. "
1163
+ f"Adjusting start_date for {ticker} from {start_date} to {new_start_date}."
1164
+ )
1165
+ start_date = new_start_date
1129
1166
 
1130
1167
  # fetch data
1131
1168
  if self.exchange.has['fetchOpenInterestHistory']:
@@ -857,10 +857,7 @@ class WrangleData:
857
857
  Dataframe with tidy data format.
858
858
  """
859
859
  # add tickers
860
- for i in range(len(self.data_req.source_markets)):
861
- df = pd.DataFrame(self.data_resp[i])
862
- self.tidy_data = pd.concat([self.tidy_data, df])
863
- self.tidy_data = self.tidy_data[['symbol', 'openInterestAmount', 'datetime']]
860
+ self.tidy_data = pd.DataFrame(self.data_resp)[['symbol', 'openInterestAmount', 'datetime']]
864
861
  self.data_resp = self.tidy_data
865
862
 
866
863
  # convert to lib fields
@@ -1245,4 +1242,4 @@ class WrangleData:
1245
1242
  if self.data_req.end_date is not None:
1246
1243
  self.data_resp = self.data_resp[(self.data_resp.index <= self.data_req.end_date)]
1247
1244
 
1248
- return self
1245
+ return self
File without changes
File without changes