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

Fix case sensitive lookups in re3data software dict #35

Merged
merged 1 commit into from
Aug 14, 2023

Conversation

Senui
Copy link
Contributor

@Senui Senui commented Jul 10, 2023

Hello!

Great little tool that could help us out a lot with automating the download process from certain data portals! Thanks for making this available to the research community!

I wanted to try it out, but bumped into a small issue, which I hope this PR fixes. When trying out a download from a Dataverse repository that is not in the fast lookup table SERVICES_NETLOC, the API resorted to the RE3DATA_SOFTWARE lookup table, where I got the following KeyError:

datahugger.get("https://doi.org/10.17026/dans-279-hy72", "data")
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/local/lib/python3.9/site-packages/datahugger/api.py", line 266, in get
    return _base_request(
  File "/usr/local/lib/python3.9/site-packages/datahugger/api.py", line 194, in _base_request
    return _base_request(
  File "/usr/local/lib/python3.9/site-packages/datahugger/api.py", line 205, in _base_request
    service_class = _resolve_service(url, doi)
  File "/usr/local/lib/python3.9/site-packages/datahugger/api.py", line 317, in _resolve_service
    service_class = _resolve_service_with_re3data(doi)
  File "/usr/local/lib/python3.9/site-packages/datahugger/api.py", line 356, in _resolve_service_with_re3data
    return RE3DATA_SOFTWARE[r_software]
KeyError: 'Dataverse'

The dataset in question can be found here: https://ssh.datastations.nl/dataset.xhtml?persistentId=doi:10.17026/dans-279-hy72

'DataVerse' is however in the RE3DATA_SOFTWARE lookup table, but with a different case. I created this pull request to make the keys in RE3DATA_SOFTWARE case-insensitive.

Cheers,
Ahmad

@J535D165 J535D165 merged commit 92aea9d into J535D165:main Aug 14, 2023
@J535D165
Copy link
Owner

Thanks!!

@J535D165
Copy link
Owner

New release available.

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

Successfully merging this pull request may close these issues.

2 participants