Open thebigdataplayer opened 1 year ago
Can you please help us with debugging.
Can you please share the output of break_dates
for the given date range, this function is in util.py
https://github.com/jugaad-py/jugaad-data/blob/master/jugaad_data/util.py
It is supposed to break the dates on month
If the above step is ok, then please check if you are getting correct data from nse website for 1/6/2021 to 31/6/2021, 1/7/2021 to 30/7/2021.. randomly for few months
If 2 is ok, check .cache folder in your home directory does it have data for those symbols
I faced the same problem with the below input:
BBOX
01-07-2021
31-07-2021
EQ
With the below snippet, I got an empty DataFrame as a response.
from jugaad_data.nse import stock_df
df = stock_df('BBOX', from_date=from_date, to_date=to_date, series=series)
On looking at the data on the NSE website, I found that the series changed from EQ
to BE
on 2021-06-09
and onwards until 2021-11-22
.
This can be fixed by changing the interface of NSEHistory._stock to accept a tuple of series, i.e. def _stock(self, symbol, from_date, to_date, series=("EQ",)):
, and its usages. See the below snippets. This can be made backwards compatible relatively easily by converting series if it is a string to a tuple of string.
Issue description
Below is the code for downloading historical stock data for a company to a CSV file
from datetime import date from jugaad_data.nse import stock_csv stock_csv(symbol="NATIONALUM", from_date=date(2020,1,1), to_date=date(2023,1,18), series="EQ", _output="D:\\Stock\\NALUM.csv")
NSE Symbol : NATIONALUM From Date : 1/1/2020 To Date : 1/18/2023
This should've pulled the data for all the 760 trading days in that time range into the CSV file. However the data is missing for the time period 10/6/2021 to 31/5/2022
This isn't a standalone issue for this particular company. All of them have the same issue of missing data for a particular period within the expected time range nationalum.txt NALUM.csv
Example Code
Error snippet