sdabhi23 / bsedata

Python library for extracting real-time data from Bombay Stock Exchange (India)
https://bsedata.readthedocs.io/en/latest/
MIT License
103 stars 48 forks source link

bhavcopy ZIP file format change issue #59

Open gaurav34065 opened 6 days ago

gaurav34065 commented 6 days ago

Looks like in here current format we're fetching as

https://www.bseindia.com/download/BhavCopy/Equity/EQ230924_CSV.ZIP

Needs to be updated like https://www.bseindia.com/download/BhavCopy/Equity/BSE_EQ_BHAVCOPY_23092024_T0.ZIP

sdabhi23 commented 5 days ago

hye @gaurav34065 is this change on BSE's end breaking the bhavcopy feature?

gaurav34065 commented 5 days ago

@sdabhi23 yes, seems like it's not able to find the bhavcopy. I tested this via below sample code

#!/bin/env python3

from bsedata.bse import BSE
from datetime import datetime, timedelta

b = BSE()
b = BSE(update_codes = True)

yesterday = datetime.now().date() - timedelta(days=1)
q = b.getBhavCopyData(yesterday)
print(q)

Getting below exception bsedata.exceptions.BhavCopyNotFound: The BhavCopy file was not found on the BSE website. You are probably trying to get data for a trading holiday.

sdabhi23 commented 5 days ago

Oh okay, I will try to release a fix sometime next week. Thanks for reporting!