Total Complexity | 1 |
Total Lines | 32 |
Duplicated Lines | 0 % |
Changes | 0 |
1 | """ |
||
2 | PubChem querying API. |
||
3 | """ |
||
4 | from __future__ import annotations |
||
5 | |||
6 | import abc |
||
7 | from typing import Union |
||
8 | |||
9 | import decorateme |
||
|
|||
10 | |||
11 | from mandos.model import Api, CompoundNotFoundError |
||
12 | from mandos.model.apis.pubchem_support.pubchem_data import PubchemData |
||
13 | |||
14 | |||
15 | class PubchemCompoundLookupError(CompoundNotFoundError): |
||
16 | """ """ |
||
17 | |||
18 | |||
19 | @decorateme.auto_repr_str() |
||
20 | class PubchemApi(Api, metaclass=abc.ABCMeta): |
||
21 | def fetch_data(self, inchikey: Union[str, int]) -> PubchemData: |
||
22 | """ |
||
23 | Fetches compound data for the given InChI Key. |
||
24 | |||
25 | Raises: |
||
26 | PubchemCompoundLookupError: If the compound ID is not found |
||
27 | """ |
||
28 | raise NotImplementedError() |
||
29 | |||
30 | |||
31 | __all__ = ["PubchemApi", "PubchemCompoundLookupError"] |
||
32 |