pratik141 / nsedt

Library to collect NSE data in pandas dataframe
http://nsedt.nse.pratikanand.co.in/
Apache License 2.0
33 stars 16 forks source link

Problem with reapeted request with the equity utility #44

Open mukundvijay123 opened 9 months ago

mukundvijay123 commented 9 months ago

i want to use the eq.get_price() function multiple times in the same program however it answers only 1 time and the returns errors show

1.First error ,this is shown once only PS C:\data\stockmarket> python z_prototyping.py { "time": "12/07/2023 06:21:19 PM", "lineno": "139", "name": "[root]", "loglevel": "ERROR", "process": "15880", "filename": "equity.py", "funcName": "get_price", "logmessage": "https://www.nseindia.com/api/historical/securityArchives?symbol=TCS&from=18-07-2023&to=06-09-2023&dataType=priceVolumeDeliverable&series=EQ got exception: Please try again in a minute.. Please try again later.", } Traceback (most recent call last): File "C:\data\stockmarket\z_prototyping.py", line 12, in print(eq.get_price(start_date, end_date, symbol="TCS")) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\python\Lib\site-packages\nsedt\equity.py", line 140, in get_price raise exc File "C:\python\Lib\site-packages\nsedt\equity.py", line 136, in get_price dataframe = future.result() ^^^^^^^^^^^^^^^ File "C:\python\Lib\concurrent\futures_base.py", line 449, in result return self.get_result() ^^^^^^^^^^^^^^^^^^^ File "C:\python\Lib\concurrent\futures_base.py", line 401, in get_result raise self._exception File "C:\python\Lib\concurrent\futures\thread.py", line 58, in run result = self.fn(*self.args, **self.kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\python\Lib\site-packages\nsedt\utils__init__.py", line 81, in fetch_url raise ValueError("Please try again in a minute.") ValueError: Please try again in a minute.

2.After the above error is shown once ,then this error keeps on occuring when i use the function

PS C:\data\stockmarket> python z_prototyping.py Traceback (most recent call last): File "C:\data\stockmarket\z_prototyping.py", line 12, in
print(eq.get_price(start_date, end_date, symbol="TCS")) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\python\Lib\site-packages\nsedt\equity.py", line 95, in get_price cookies = utils.get_cookies() ^^^^^^^^^^^^^^^^^^^ File "C:\python\Lib\site-packages\nsedt\utils__init__.py", line 46, in get_cookies raise ValueError("Retry again in a minute.") ValueError: Retry again in a minute.

--I have been using this on google colab and it works everytime,but doesnt run on my local linux and windows sytem the above error keeps occuring. Any help and suggestion on how i can get it working ,pls help.

pratik141 commented 8 months ago

I am not able to reproduce this but I am trying to investigate it