Not able to retrieve historical data for many NSE symbols
Opened this issue · 1 comments
miralchevli commented
Issue description
Not able to retrieve historical data for many NSE symbols like DBCORP, SHIVATEX, PFS
Example Code
from datetime import datetime, timedelta
from jugaad_data.nse import stock_df
today = datetime.now().date()
to_date = today - timedelta(days=1)
from_date = today - timedelta(days=30)
d = stock_df('DBCORP', from_date, to_date)
print(d)
Error snippet
Traceback (most recent call last):
File "C:\Users\MiralPramodkumarChev\PycharmProjects\MirDhan\zerodha.py", line 138, in <module>
d = stock_df('SHIVATEX', from_date, to_date)
File "C:\Program Files\Python38\lib\site-packages\jugaad_data\nse\history.py", line 178, in stock_df
df = pd.DataFrame(raw)[stock_select_headers]
File "C:\Program Files\Python38\lib\site-packages\pandas\core\frame.py", line 3767, in __getitem__
indexer = self.columns._get_indexer_strict(key, "columns")[1]
File "C:\Program Files\Python38\lib\site-packages\pandas\core\indexes\base.py", line 5877, in _get_indexer_strict
self._raise_if_missing(keyarr, indexer, axis_name)
File "C:\Program Files\Python38\lib\site-packages\pandas\core\indexes\base.py", line 5938, in _raise_if_missing
raise KeyError(f"None of [{key}] are in the [{axis_name}]")
KeyError: "None of [Index(['CH_TIMESTAMP', 'CH_SERIES', 'CH_OPENING_PRICE', 'CH_TRADE_HIGH_PRICE',\n 'CH_TRADE_LOW_PRICE', 'CH_PREVIOUS_CLS_PRICE', 'CH_LAST_TRADED_PRICE',\n 'CH_CLOSING_PRICE', 'VWAP', 'CH_52WEEK_HIGH_PRICE',\n 'CH_52WEEK_LOW_PRICE', 'CH_TOT_TRADED_QTY', 'CH_TOT_TRADED_VAL',\n 'CH_TOTAL_TRADES', 'CH_SYMBOL'],\n dtype='object')] are in the [columns]"
chunks <generator object Executor.map.<locals>.result_iterator at 0x000001D17F952510>
devfinwiz commented
I feel this library is not being actively maintained. You can consider giving https://github.com/devfinwiz/Fin-Maestro-Kin a look as a replacement until this library is back in action.
Note: Fin Maestro Kin is in its early stages of development.
Documentation: https://fin-maestro-kin.apidog.io/