Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

File is not zip and index out of range #10

Closed
pinpss opened this issue Oct 18, 2022 · 4 comments
Closed

File is not zip and index out of range #10

pinpss opened this issue Oct 18, 2022 · 4 comments

Comments

@pinpss
Copy link

pinpss commented Oct 18, 2022

Hello,
This package looks really promising. I was trying to run the example codes and got the following errors (I tried running it on my computer and thru google colab without luck)

from python_lei.utils import Download
Download()

ERROR:python_lei.utils:No response from GLEIF server.
---------------------------------------------------------------------------
BadZipFile                                Traceback (most recent call last)
[<ipython-input-2-2647fe19722e>](https://cydm97mcqmq-496ff2e9c6d22116-0-colab.googleusercontent.com/outputframe.html?vrz=colab-20221017-060050-RC00_481597456#) in <module>
      1 from python_lei.utils import Download
----> 2 Download()
      3 

3 frames
[/usr/lib/python3.7/zipfile.py](https://cydm97mcqmq-496ff2e9c6d22116-0-colab.googleusercontent.com/outputframe.html?vrz=colab-20221017-060050-RC00_481597456#) in _RealGetContents(self)
   1323             raise BadZipFile("File is not a zip file")
   1324         if not endrec:
-> 1325             raise BadZipFile("File is not a zip file")
   1326         if self.debug > 1:
   1327             print(endrec)

BadZipFile: File is not a zip file

and for the lei_isin conversion:

from python_lei.isin_lei import LEItoISIN
lei_to_isin = LEItoISIN()

IndexError                                Traceback (most recent call last)
[<ipython-input-3-7903da1e8e7c>](https://cydm97mcqmq-496ff2e9c6d22116-0-colab.googleusercontent.com/outputframe.html?vrz=colab-20221017-060050-RC00_481597456#) in <module>
      1 from python_lei.isin_lei import LEItoISIN
----> 2 lei_to_isin = LEItoISIN()

1 frames
[/usr/local/lib/python3.7/dist-packages/python_lei/utils.py](https://cydm97mcqmq-496ff2e9c6d22116-0-colab.googleusercontent.com/outputframe.html?vrz=colab-20221017-060050-RC00_481597456#) in load_data()
     96     Loads and Returns the dataframe
     97     """
---> 98     dataframe = pd.read_csv(os.path.join(RESOURCE_DIR, os.listdir(RESOURCE_DIR)[0]))
     99     return dataframe

IndexError: list index out of range

@jdvala
Copy link
Owner

jdvala commented Oct 28, 2022

Hi @pinpss, thank you for your kind words. I am not aware about this problem. I will take a look at the problem this weekend. Thank you for reporting.

@Kamparia
Copy link

Kamparia commented Oct 16, 2023

Hi @jdvala, any update on this issue? I am getting the same error message.

https://www.gleif.org/en/lei-data/lei-mapping/download-isin-to-lei-relationship-files

@jdvala
Copy link
Owner

jdvala commented Sep 24, 2024

The website has changed how the files are downloaded.

@jdvala
Copy link
Owner

jdvala commented Oct 6, 2024

Issue should be fixed in #12 please download the updated version of python-lei (0.1.2)

@jdvala jdvala closed this as completed Oct 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants