swapniljariwala / nsepy

Python Library to get publicly available data on NSE website ie. stock quotes, historical data, live indices
https://nsepy-xyz.web.app
Other
758 stars 377 forks source link

Missing entries from Downloaded BhavCopy #227

Open siddcyber opened 2 years ago

siddcyber commented 2 years ago

When compared to the originally dpwnloaded file directly from NSE website many entries are missing. Please provide a fix. Attaching Code used and compared picture of the issue in question. BhavCopy missing entries

`from datetime import date, datetime, timedelta from nsepy.history import get_price_list

today = date.today() # today's date nameDateToday = datetime.today() # today's date for file naming yesterday = today - timedelta(days=1) # yesterday's date nameDateYesterday = nameDateToday - timedelta(days=1) # Yesterday's date for file naming prises = get_price_list(dt=yesterday) # gets latest Bhav NSE copy list

saving of file in CSV format with name

prises.to_csv(os.path.join(path, 'cm' + nameDateYesterday.strftime("%d%b%Y") + 'bhav.csv')) `