moleculeresolver.molecule ========================= .. py:module:: moleculeresolver.molecule Classes ------- .. autoapisummary:: moleculeresolver.molecule.Molecule Module Contents --------------- .. py:class:: 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. .. py:attribute:: SMILES :type: Optional[str] :value: None .. py:attribute:: synonyms :type: Optional[List[str]] :value: [] .. py:attribute:: CAS :type: Optional[List[str]] :value: [] .. py:attribute:: additional_information :type: Optional[str] :value: '' .. py:attribute:: mode :type: Optional[str] :value: '' .. py:attribute:: service :type: Optional[str] :value: '' .. py:attribute:: number_of_crosschecks :type: Optional[int] :value: 1 .. py:attribute:: identifier :type: Optional[str] :value: '' .. py:attribute:: found_molecules :type: Optional[list] :value: [] .. py:method:: to_dict(found_molecules: Optional[str] = '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.