Skip to content

Commit

Permalink
Check all available checksum algorithm in DataVerse registry population
Browse files Browse the repository at this point in the history
  • Loading branch information
dokempf committed Oct 1, 2024
1 parent 14d14e4 commit d74bda3
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions pooch/downloaders.py
Original file line number Diff line number Diff line change
Expand Up @@ -1158,6 +1158,9 @@ def populate_registry(self, pooch):
"""

for filedata in self.api_response.json()["data"]["latestVersion"]["files"]:
pooch.registry[filedata["dataFile"]["filename"]] = (
f"md5:{filedata['dataFile']['md5']}"
)
for algorithm in ["md5", "sha1", "sha256", "sha512"]:
if algorithm in filedata["dataFile"]:
pooch.registry[filedata["dataFile"]["filename"]] = (
f"{algorithm}:{filedata['dataFile'][algorithm]}"
)
break

0 comments on commit d74bda3

Please sign in to comment.