TCT.name_resolver¶
This is a wrapper around the Name Resolver API.
API docs: https://name-lookup.ci.transltr.io/doc
- TCT.name_resolver.lookup(query: str, return_top_response: bool = True, return_synonyms: bool = False, **kwargs)[source]¶
A wrapper around the lookup api endpoint. Given a query string, this returns a TranslatorNode object or a list of TranslatorNode objects corresponding to the given name.
- Parameters:
- querystr
Query string
- return_top_responsebool
If true, this returns only the top response. If false, this returns a list of all responses. Default: True
- return_synonymsbool
If true, the resulting TranslatorNode objects contain a list of synonyms. If false, they do not include synonyms. Default: False
- **kwargs
Other arguments to lookup
- Returns:
- TranslatorNode object if return_top_response is True, list of TranslatorNode objects if return_top_response is False
Examples
>>> lookup('AML') TranslatorNode(curie='MONDO:0018874', label='acute myeloid leukemia', types=['biolink:Disease', 'biolink:DiseaseOrPhenotypicFeature', 'biolink:BiologicalEntity', 'biolink:ThingWithTaxon', 'biolink:NamedThing', 'biolink:Entity'], synonyms=None, curie_synonyms=None)
- TCT.name_resolver.synonyms(query: str, **kwargs)[source]¶
A wrapper around the synonyms api endpoint. Given a query string, this returns a TranslatorNode object or a list of TranslatorNode objects corresponding to the given name.
- Parameters:
- querystr
Query CURIE
- **kwargs
Other arguments to synonyms
- Returns:
- Dict of CURIE idTranslatorNode