moleculeresolver.molecule

Classes

Molecule

Represents a molecule with various properties and identifiers.

Module Contents

class moleculeresolver.molecule.Molecule

Represents a molecule with various properties and identifiers.

Attributes:

SMILES (Optional[str]): The SMILES (Simplified Molecular Input Line Entry System) representation of the molecule.

synonyms (Optional[list[str]]): A list of alternative names or synonyms for the molecule.

CAS (Optional[list[str]]): A list of CAS (Chemical Abstracts Service) registry numbers for the molecule.

additional_information (Optional[str]): Any additional information about the molecule.

mode (Optional[str]): The mode associated with the molecule.

service (Optional[str]): The service associated with the molecule.

number_of_crosschecks (Optional[int]): The number of cross-checks performed on the molecule.

identifier (Optional[str]): A unique identifier for the molecule.

found_molecules (Optional[list]): A list of related molecules found during processing.

SMILES: str | None = None
synonyms: List[str] | None = []
CAS: List[str] | None = []
additional_information: str | None = ''
mode: str | None = ''
service: str | None = ''
number_of_crosschecks: int | None = 1
identifier: str | None = ''
found_molecules: list | None = []
to_dict(found_molecules: str | None = 'recursive') Dict[str, Any]

Convert the Molecule object to a dictionary.

Args:
found_molecules (Optional[str]): Determines how ‘found_molecules’ are handled.
  • If ‘remove’, the ‘found_molecules’ field will be excluded.

  • If ‘recursive’, ‘found_molecules’ will be recursively converted to dictionaries.

Returns:

Dict[str, Any]: A dictionary representation of the Molecule object.

Note:

This method creates a deep copy of the object’s __dict__ attribute. Depending on the found_molecules parameter, it may exclude or recursively convert the ‘found_molecules’ field before returning the dictionary.