Comments (8)
def __download(self, url: str, folder: Path):
'''Download a large file in chunks from the given url.
Returns pathlib.Path object of the downloaded file'''
fname = folder / url.split("/")[-1]
th.check()
with self.session.get(url, stream=True, timeout=15) as r:
contentType = r.headers.get('content-type')
if contentType and 'text/html' in contentType:
raise RuntimeError(
'NSE file is unavailable or not yet updated.')
with fname.open(mode='wb') as f:
for chunk in r.iter_content(chunk_size=1000000):
f.write(chunk)
return fname
from eod2.
Hi Arun,
Did you run this code today?
I ran mine today at 7pm and everything is working fine. Most likely you ran it before 7pm. In that case, rerun the script and all should be fine.
Downloading Files
Starting Data Sync
EOD sync complete
Index sync complete.
Makings adjustments for splits and bonus
Cleaning up files
0 files deleted
03 Jan 2024: Done
----------------------------------------------------
Regardless, check your EOD2 version, run py init.py -v
it should read version 5.1.0
. If not try updating the both the repo and eod2_data
If all else fails, open the meta.json
file in eod2_data
folder and let me know the last update date.
Hope your coding journey is going well. 😄
from eod2.
Hi, Benny.
Tried in a fresh setup
C:\TestEod2\eod2>python setup.py
eod2_data folder has data. Renaming folder to eod2_data_backup.
Downloading eod2_data from https://github.com/BennyThadikaran/eod2_data/archive/main.zip
Download success.
Extracting Zipfile to eod2_data
Done
C:\TestEod2\eod2>cd src
C:\TestEod2\eod2\src>python init.py
NSE Holiday list updated
Downloading Files
RuntimeError('NSE file is unavailable or not yet updated.')
C:\TestEod2\eod2\src>py init.py -v
EOD2 init.py: version 5.1.0
C:\TestEod2\eod2\src>
Will try it tomorrow morning from different network connection to rule out network issue.
Thanks for the quick response.
from eod2.
Oh ok you're not using git. I will test with setup.py
in the morning and get back.
Can you also tell me what the lastUpdate
is showing on eod2_data/meta.json
. I can replicate the issue better that way.
Thanks for bringing this up. 👍
from eod2.
Hi Arun, I see the problem now. I work on a fix and get back to you. Thanks again for reporting this.
from eod2.
This is a nasty little error. It occurs in defs.py:checkForHolidays
- Since 25th Dec 2023 was Christmas holiday, it tried to redownload the holiday list to confirm.
- Since it is 2024 now, NSE returned holidays for 2024 and not 2023
- 25-Dec-2023 was not found in the holiday list, so it proceeded to download the data, resulting in the error.
I update EOD2 on a daily basis, so never encountered the error.
Primary issues are:
- We cannot get the previous year holiday data.
- Some holiday dates can change from year to year. If user has not synced their data in a long time, risk of such an issue occuring is higher.
I will go ahead and sync the eod2_data
folder, so anyone affected by this issue can update the eod2_data
folder from the repo and move on.
Keep this issue open, I need to spend some time considering a fix.
from eod2.
eod2_data
is fully updated now upto 3rd Jan 2024. You can delete the eod2_data
folder in your local repo and run py setup.py
to get the latest data. Everything should work fine then.
For git users follow this instruction here update git repo and eod2_data
from eod2.
Awesome Benny. Missed updating during end of the year due to vacation. Thanks for the clear explanation. Will mark this as resolved.
from eod2.
Related Issues (20)
- Error downloading data when import to Amibroker flag is set to True HOT 6
- ValueError when using plot.py under certain conditions
- Custom user defined mechanism for saving data to alternate storage. HOT 5
- Stocks data not adjusted for splits HOT 1
- Data import failed HOT 4
- Data Update Error HOT 9
- Add ETF stock data to EOD2 - WIP
- Switch to NSE pip package for all Nse related definitions - WIP
- Merge daily and delivery files into a single CSV file
- Check for data integrity
- Incorrect volume in Amibroker formated files
- Plot.py attribute error with --ls option
- Plot.py: FileNotFoundError when saving trend lines to file
- Protocol to handle delayed NSE delivery reports HOT 1
- Make EOD2 compatible with Python version >=3.8 HOT 1
- Kansai Nerolac 4th July bonus not adjusted
- India Vix.csv: Column type Mismatch in Volume. Expected float64 or int64. Got object
- Special Session of 20 Jan 2024 Not getting updated HOT 2
- Error Coming in Making Adjustments - KeyError(datetime.datetime(2024,1,25,0,0) HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from eod2.