Skip to content

Unichem

Implementation of the UniChem API parser class.

UniChemAPI(base_url=None, task='search', output_dir=None, **kwargs)

Bases: BaseAPI

class for UniChem calls via the REST API and FTP bulk mappings.

Tasks - search : search for compounds given an ID in one source, find its equivalents in other _SOURCES. - connectivity : connectivity search using InChI / InChIKey / sourceID. - mapping" : download whole-source mapping files from the FTP, save them as Parquet

Initialize the UniChemAPI object.

PARAMETER DESCRIPTION
base_url

Override for the base URL. Falls back to _BASE_URL

TYPE: str | None DEFAULT: None

task

Task type: search, connectivity, or mapping. Defaults to search.

TYPE: str DEFAULT: 'search'

output_dir

Directory to save output files. Defaults to None.

TYPE: str | None DEFAULT: None

output_dir = output_dir

task = task