Skip to content

Commit

Permalink
Improve download getters
Browse files Browse the repository at this point in the history
  • Loading branch information
cthoyt committed Jun 24, 2021
1 parent 3ce3d45 commit 0da0552
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/bioregistry/resolve.py
Original file line number Diff line number Diff line change
Expand Up @@ -630,6 +630,8 @@ def get_obo_download(prefix: str) -> Optional[str]:
entry = get(prefix)
if entry is None:
return None
if entry.download_obo:
return entry.download_obo
return get_external(prefix, 'obofoundry').get('download.obo')


Expand All @@ -646,7 +648,13 @@ def get_owl_download(prefix: str) -> Optional[str]:
entry = get(prefix)
if entry is None:
return None
return get_external(prefix, 'ols').get('version.iri') or get_external(prefix, 'obofoundry').get('download.owl')
if entry.download_owl:
return entry.download_owl
return (
get_external(prefix, 'ols').get('version.iri')
or get_external(prefix, 'ols').get('download')
or get_external(prefix, 'obofoundry').get('download.owl')
)


def is_provider(prefix: str) -> bool:
Expand Down

0 comments on commit 0da0552

Please sign in to comment.