Skip to content

list index out of range when using WorksContainer #106

Closed
@IvanSterligov

Description

@IvanSterligov

hi there, and thank you for your useful library!

I'm using the latest habanero build (pip installed today) and get an error when trying to put results in a WorkContainer

from habanero import Crossref, WorksContainer
cr = Crossref(mailto = "(my email)")
res = cr.works(query_affiliation='Higher School of Economics*', cursor='*', works=True, cursor_max=500, progress_bar=True)
x=WorksContainer(res)
print(x)

Traceback (most recent call last):
File "xxx.py", line 4, in
x=WorksContainer(res)
File "xxx\Python310\lib\site-packages\habanero\crossref\workscontainer.py", line 44, in init
keys = list(self.works[0].keys())
IndexError: list index out of range

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions