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

Using the Bioregistry to check for prefixes #12

Open
cthoyt opened this issue Jun 9, 2021 · 0 comments
Open

Using the Bioregistry to check for prefixes #12

cthoyt opened this issue Jun 9, 2021 · 0 comments

Comments

@cthoyt
Copy link

cthoyt commented Jun 9, 2021

The Bioregistry (https://bioregistry.io; https://github.com/bioregistry/bioregistry) integrates the resources mentioned on the readme as well as several more. You could ping its API to see if there is a prefix (or synonym of a prefix) already available:

import requests

prefix = ...
res = requests.get(f'https://bioregistry.io/api/registry/{prefix}').json()

I just realized it gives a 500 if there's no entry so I need to make an update. Alternatively you could pip install the package that holds the data and do

import bioregistry

resource = bioregistry.get('nope')
assert resource is None
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

No branches or pull requests

1 participant