Giter Club home page Giter Club logo

Comments (8)

ArunTS96 avatar ArunTS96 commented on July 20, 2024
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.

BennyThadikaran avatar BennyThadikaran commented on July 20, 2024

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.

ArunTS96 avatar ArunTS96 commented on July 20, 2024

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.

BennyThadikaran avatar BennyThadikaran commented on July 20, 2024

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.

BennyThadikaran avatar BennyThadikaran commented on July 20, 2024

Hi Arun, I see the problem now. I work on a fix and get back to you. Thanks again for reporting this.

from eod2.

BennyThadikaran avatar BennyThadikaran commented on July 20, 2024

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:

  1. We cannot get the previous year holiday data.
  2. 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.

BennyThadikaran avatar BennyThadikaran commented on July 20, 2024

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.

ArunTS96 avatar ArunTS96 commented on July 20, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.