Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Not able to retrieve historical data for many NSE symbols #74

Open
miralchevli opened this issue Apr 21, 2024 · 1 comment
Open

Not able to retrieve historical data for many NSE symbols #74

miralchevli opened this issue Apr 21, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@miralchevli
Copy link

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>
@miralchevli miralchevli added the bug Something isn't working label Apr 21, 2024
@devfinwiz
Copy link

devfinwiz commented Apr 21, 2024

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/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants