Skip to content

Using the Bioregistry to check for prefixes #12

@cthoyt

Description

@cthoyt

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions