polymerist.smileslib.chemdbqueries
For querying chemical databases for information about molecules specified by SMILES string and other structures
Attributes
Exceptions
Raised when attempting to query a property that a chemical database service cannot provide |
|
Raised when a chemical database query doesn't fail BUT returns a NoneType where not allowed |
|
Raised when a chemical data query is unfulfilled by a service |
Classes
Implementation of queries from a particular chemical database |
|
Implementation of chemical query requests to the NIH's CADD group |
|
Implementation of chemical query requests to PubChem via the |
Functions
|
Attempt to fetch a molecular property from a variety of chemical database services, either |
Module Contents
- polymerist.smileslib.chemdbqueries.LOGGER
- exception polymerist.smileslib.chemdbqueries.InvalidPropertyError[source]
Bases:
ExceptionRaised when attempting to query a property that a chemical database service cannot provide
- exception polymerist.smileslib.chemdbqueries.NullPropertyResponse[source]
Bases:
ExceptionRaised when a chemical database query doesn’t fail BUT returns a NoneType where not allowed
- exception polymerist.smileslib.chemdbqueries.ChemicalDataQueryFailed[source]
Bases:
ExceptionRaised when a chemical data query is unfulfilled by a service
- class polymerist.smileslib.chemdbqueries.ChemDBServiceQueryStrategy[source]
Bases:
abc.ABCImplementation of queries from a particular chemical database
- classmethod dependencies() Iterable[str][source]
For internals, allows dynamic checking for package dependencies (useful for automating unit test boilerplate)
- classmethod is_online() bool[source]
- Abstractmethod:
Check if the service being queried is online and can accept requests
- classmethod queryable_properties() Container[str][source]
- Abstractmethod:
List which chemical property names can be queried from the service
- classmethod queryable_namespaces() Container[str][source]
- Abstractmethod:
List which chemical identification types can be searched through by the service
- polymerist.smileslib.chemdbqueries.cirpy_error
- class polymerist.smileslib.chemdbqueries.NIHCACTUSQueryStrategy[source]
Bases:
ChemDBServiceQueryStrategyImplementation of chemical query requests to the NIH’s CADD group Cheminformatics Tools and User Services (CACTUS) Chemical Identifier Resolver (CIR)
- service_name: ClassVar[str] = 'NIH CACTUS CIR'
- classmethod dependencies()[source]
For internals, allows dynamic checking for package dependencies (useful for automating unit test boilerplate)
- classmethod queryable_properties() set[str][source]
List which chemical property names can be queried from the service
- polymerist.smileslib.chemdbqueries.pubchempy_error
- class polymerist.smileslib.chemdbqueries.PubChemQueryStrategy[source]
Bases:
ChemDBServiceQueryStrategyImplementation of chemical query requests to PubChem via the PUG REST API (https://pubchem.ncbi.nlm.nih.gov/docs/pug-rest)
- service_name: ClassVar[str] = 'PubChem'
- classmethod dependencies()[source]
For internals, allows dynamic checking for package dependencies (useful for automating unit test boilerplate)
- classmethod is_online()[source]
Check if the service being queried is online and can accept requests
- polymerist.smileslib.chemdbqueries.get_chemical_property(property_name: str, identifier: str, namespace: str = 'smiles', keep_first_only: bool = True, allow_null_return: bool = False, fail_quietly: bool = False, services: Sequence[ChemDBServiceQueryStrategy] | None = None, **kwargs) Any | None[source]
Attempt to fetch a molecular property from a variety of chemical database services, either provided manually (in the order they should be checked) or ALL implemented service queries by default
Will return the first valid returned result or, if all services fail, raise Exception