OEReadMolFromBytes

OEReadMolFromBytes(OEMolBase, format, data) -> bool
OEReadMolFromBytes(OEMolBase, format, gzip, data) -> bool
OEReadMolFromBytes(OEMolBase, format, flavor, gzip, data) -> bool

OEReadMolFromBytes(OEMCMolBase, format, data) -> bool
OEReadMolFromBytes(OEMCMolBase, format, gzip, data) -> bool
OEReadMolFromBytes(OEMCMolBase, format, flavor, gzip, data) -> bool

Instantiates a molecule from the contents of ‘data’ in terms of ‘format’. ‘format’ must be a file extension that is readable by OpenEye, for example: “.oeb.gz”. Overloads which take a Boolean ‘gzip’ parameter or an unsigned ‘flavor’ and Boolean ‘gzip’ parameters expect the format or the format and flavor to be specified by one of the constants in OEFormat and OEIFlavor.

Returns ‘true’ if decoding was successful.

mol = oechem.OEGraphMol()
success = oechem.OEReadMolFromBytes(mol, ".smi", "c1ccccc1")
mol = oechem.OEGraphMol()
success = oechem.OEReadMolFromBytes(mol, oechem.OEFormat_SMI, False, "c1ccccc1")
mol = oechem.OEGraphMol()
success = oechem.OEReadMolFromBytes(mol, oechem.OEFormat_SMI,
                                    oechem.OEGetDefaultIFlavor(oechem.OEFormat_SMI),
                                    False, "c1ccccc1")