Passed
Push — main ( 4074a3...6b8d16 )
by Douglas
01:56
created

mandos.model.apis.pubchem_api   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 32
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 13
dl 0
loc 32
rs 10
c 0
b 0
f 0
wmc 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A PubchemApi.fetch_data() 0 8 1
1
"""
2
PubChem querying API.
3
"""
4
from __future__ import annotations
5
6
import abc
7
from typing import Union
8
9
import decorateme
0 ignored issues
show
introduced by
Unable to import 'decorateme'
Loading history...
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):
0 ignored issues
show
Documentation introduced by
Empty class docstring
Loading history...
16
    """ """
17
18
19
@decorateme.auto_repr_str()
0 ignored issues
show
introduced by
Missing class docstring
Loading history...
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