Skip to content

Commit

Permalink
Fix case sensitive lookups in re3data software dict (#35)
Browse files Browse the repository at this point in the history
Co-authored-by: Ahmad Hesam <[email protected]>
  • Loading branch information
Senui and Ahmad Hesam authored Aug 14, 2023
1 parent 6a508fb commit 92aea9d
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions datahugger/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -135,8 +135,9 @@
r".*\/handle\/\d+\/\d+": DSpaceDataset,
}

# add keys in lower-case for fast case-insensitive lookups
RE3DATA_SOFTWARE = {
"DataVerse": DataverseDataset, # Hits on re3data 2022-09-02: (145)
"dataverse": DataverseDataset, # Hits on re3data 2022-09-02: (145)
# "DSpace": DSpaceDataset, # Hits on re3data 2022-09-02: (115)
# "CKAN": CKANDataset, # Hits on re3data 2022-09-02: (89)
# "MySQL": MySQLDataset, # Hits on re3data 2022-09-02: (86)
Expand Down Expand Up @@ -353,4 +354,4 @@ def _resolve_service_with_re3data(doi):

r_software = get_re3data_repository(repo["id"])

return RE3DATA_SOFTWARE[r_software]
return RE3DATA_SOFTWARE[r_software.lower()]

0 comments on commit 92aea9d

Please sign in to comment.