thermo.identifiers module

thermo.identifiers.checkCAS(CASRN)[source]

Checks if a CAS number is valid. Crashes if not.

Parameters:

CASRN : string

A three-piece, dash-separated set of numbers

Returns:

result : bool

Boolean value if CASRN was valid. If parsing fails, return False also.

Notes

Check method is according to Chemical Abstract Society. However, no lookup to their service is performed; therefore, this function cannot detect false positives.

Function also does not support additional separators, apart from ‘-‘.

References

TODO

Examples

>>> checkCAS('7732-18-5')
True
>>> checkCAS('77332-18-5')
False
thermo.identifiers.CASfromAny(ID)[source]

Input must be string First check if input is InChI, best defined format TODO: if int, format as rest-2digits-1digit and see if in dict. All CASs are in there.

thermo.identifiers.PubChem(CASRN)[source]

Given a CASRN in the database, obtain the PubChem database number of the compound.

Parameters:

CASRN : string

Valid CAS number in PubChem database

Returns:

pubchem : int

PubChem database id, as an integer

Notes

CASRN must be an indexing key in the pubchem database.

References

[R391]Pubchem.

Examples

>>> PubChem('7732-18-5')
962
thermo.identifiers.MW(CASRN)[source]

Given a CASRN in the database, obtain the Molecular weight of the compound, if it is in the database.

Parameters:

CASRN : string

Valid CAS number in PubChem database

Returns:

MolecularWeight : float

Notes

CASRN must be an indexing key in the pubchem database. No MW Calculation is performed; nor are any historical isotopic corrections applied.

References

[R392]Pubchem.

Examples

>>> MW('7732-18-5')
18.01528
thermo.identifiers.formula(CASRN)[source]
>>> formula('7732-18-5')
'H2O'
thermo.identifiers.smiles(CASRN)[source]
>>> smiles('7732-18-5')
'O'
thermo.identifiers.InChI(CASRN)[source]
>>> InChI('7732-18-5')
'H2O/h1H2'
thermo.identifiers.InChI_Key(CASRN)[source]
>>> InChI_Key('7732-18-5')
'XLYOFNOQVPJJNP-UHFFFAOYSA-N'
thermo.identifiers.IUPAC_name(CASRN)[source]
>>> IUPAC_name('7732-18-5')
'oxidane'
thermo.identifiers.name(CASRN)[source]
>>> name('7732-18-5')
'water'
thermo.identifiers.synonyms(CASRN)[source]
>>> synonyms('98-00-0')
['furan-2-ylmethanol', 'furfuryl alcohol', '2-furanmethanol', '2-furancarbinol', '2-furylmethanol', '2-furylcarbinol', '98-00-0', '2-furanylmethanol', 'furfuranol', 'furan-2-ylmethanol', '2-furfuryl alcohol', '5-hydroxymethylfuran', 'furfural alcohol', 'alpha-furylcarbinol', '2-hydroxymethylfuran', 'furfuralcohol', 'furylcarbinol', 'furyl alcohol', '2-(hydroxymethyl)furan', 'furan-2-yl-methanol', 'furfurylalcohol', 'furfurylcarb', 'methanol, (2-furyl)-', '2-furfurylalkohol', 'furan-2-methanol', '2-furane-methanol', '2-furanmethanol, homopolymer', '(2-furyl)methanol', '2-hydroxymethylfurane', 'furylcarbinol (van)', '2-furylmethan-1-ol', '25212-86-6', '93793-62-5', 'furanmethanol', 'polyfurfuryl alcohol', 'pffa', 'poly(furfurylalcohol)', 'poly-furfuryl alcohol', '(fur-2-yl)methanol', '.alpha.-furylcarbinol', '2-hydroxymethyl-furan', 'poly(furfuryl alcohol)', '.alpha.-furfuryl alcohol', 'agn-pc-04y237', 'h159', 'omega-hydroxypoly(furan-2,5-diylmethylene)', '(2-furyl)-methanol (furfurylalcohol)', '40795-25-3', '88161-36-8']
thermo.identifiers.mixture_from_any(ID)[source]