API Usage

The Biolookup Service is built on Flask as a thin wrapper around the biolookup Python package. It exposes a single endpoint for accessing entity metadata for which Swagger API documentation is automatically generated by Flasgger.

See the remaining Biolookup Service API documentation or follow this example for getting metadata for a given CURIE in Python:

import requests
res = requests.get("http://biolookup.io/api/lookup/doid:14330").json()
assert res["name"] == "Parkinson's disease"
assert res["identifier"] == "14330"
assert res["prefix"] == "doid"
assert res["definition"] is not None  # not shown for brevity

Python Package Usage

The Python source code can be found at biopragmatics/biolookup. It can be installed with pip install biolookup or in development mode by following these instructions.

The biolookup Python package can be used to interact with the web service or directly with the database if it's pre-configured.

import biolookup

res = biolookup.lookup("doid:14330")
assert res["name"] == "Parkinson's disease"
assert res["identifier"] == "14330"
assert res["prefix"] == "doid"
assert res["definition"] is not None  # not shown for brevity

Local Deployment of the Biolookup Service

As the biolookup package is open source, it's possible to host your own instance of the Biolookup Service. Further, it's possible create a local derivative of the database with a custom instance of the Bioregistry. Here are examples how to do that:

Python CLI

You can also install and run the Biolookup Service from the shell:

$ pip install biolookup
$ biolookup web

You can also download the source code, install in development mode, and run the Biolookup Service from the shell:

$ git clone https://github.com/biopragmatics/biolookup.git
$ cd biolookup
$ pip install --editable .
$ biolookup web

Docker

You can deploy your own instance of the Biolookup Service with:

$ docker run -id -p 8765:8765 biopragmatics/biolookup:latest

If you want to load a custom database with a Docker-based deployment, please see the dockerfile in biopragmatics/biolookup-docker for inspiration.