Skip to content

webservices.chebi

Substance information from ChEBI.

Queries the ChEBI web service for the information stored for a term, such as the InChIKey, which can then be used to look up cross references with pymetadata.webservices.unichem.

from pymetadata.webservices.chebi import ChebiQuery

info = ChebiQuery.query("CHEBI:33699")

See https://www.ebi.ac.uk/chebi/.

ChebiQuery

Queries against the ChEBI web service.

Responses are cached on disk for CACHE_DURATION_ONTOLOGY hours, see pymetadata.CACHE_USE. If ChEBI cannot be reached, cached content is used however old it is.

query staticmethod

query(chebi, cache=None, cache_path=None)

Query the information stored for a ChEBI term.

Parameters:

Name Type Description Default
chebi str

ChEBI term, e.g., CHEBI:33699

required
cache bool | None

cache the response, defaults to pymetadata.CACHE_USE

None
cache_path Path | None

directory for cached responses, defaults to pymetadata.CACHE_PATH

None

Returns:

Type Description
dict

The ChEBI information, empty if the term could not be resolved.