identifiers

All data and methods related to chemical identifiers.

thermosteam.properties.identifiers.checkCAS(CASRN)[source]

Checks if a CAS number is valid. Returns False if the parser cannot parse the given string..

Parameters

CASRN (string) – A three-piece, dash-separated set of numbers

Returns

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

Return type

bool

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 ‘-‘.

CAS numbers up to the series 1 XXX XXX-XX-X are now being issued.

A long can hold CAS numbers up to 2 147 483-64-7

Examples

>>> checkCAS('7732-18-5')
True
>>> checkCAS('77332-18-5')
False
thermosteam.properties.identifiers.chemical_metadata_from_any(ID)[source]

Looks up metadata of a chemical by searching and testing for the string being any of the following types of chemical identifiers:

  • Name, in IUPAC form or common form or a synonym registered in PubChem

  • InChI name, prefixed by ‘InChI=1S/’ or ‘InChI=1/’

  • InChI key, prefixed by ‘InChIKey=’

  • PubChem CID, prefixed by ‘PubChem=’

  • SMILES (prefix with ‘SMILES=’ to ensure smiles parsing; ex. ‘C’ will return Carbon as it is an element whereas the SMILES interpretation for ‘C’ is methane)

  • CAS number (obsolete numbers may point to the current number)

If the input is an ID representing an element, the following additional inputs may be specified as

  • Atomic symbol (ex ‘Na’)

  • Atomic number (as a string)

Parameters

ID (str) – One of the name formats described above

Returns

metadata

Return type

ChemicalMetadata

Notes

A LookupError is raised if the name cannot be identified. The PubChem database includes a wide variety of other synonyms, but these may not be present for all chemcials.

Examples

>>> chemical_metadata_from_any('water')
<ChemicalMetadata: 7732-18-5>
>>> chemical_metadata_from_any('InChI=1S/C2H6O/c1-2-3/h3H,2H2,1H3')
<ChemicalMetadata: 64-17-5>
>>> chemical_metadata_from_any('CCCCCCCCCC')
<ChemicalMetadata: 124-18-5>
>>> chemical_metadata_from_any('InChIKey=LFQSCWFLJHTTHZ-UHFFFAOYSA-N')
<ChemicalMetadata: 64-17-5>
>>> chemical_metadata_from_any('pubchem=702')
<ChemicalMetadata: 64-17-5>
>>> chemical_metadata_from_any('O') # only elements can be specified by symbol
<ChemicalMetadata: 17778-80-2>
thermosteam.properties.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 – PubChem database id, as an integer [-]

Return type

int

Notes

CASRN must be an indexing key in the pubchem database.

Examples

>>> PubChem('7732-18-5')
962

References

1

Pubchem.

thermosteam.properties.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

Return type

float

Notes

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

Examples

>>> MW('7732-18-5')
18.01528

References

1

Pubchem.

thermosteam.properties.identifiers.formula(CASRN)[source]
>>> formula('7732-18-5')
'H2O'
thermosteam.properties.identifiers.smiles(CASRN)[source]
>>> smiles('7732-18-5')
'O'
thermosteam.properties.identifiers.InChI(CASRN)[source]
>>> InChI('7732-18-5')
'H2O/h1H2'
thermosteam.properties.identifiers.InChI_Key(CASRN)[source]
>>> InChI_Key('7732-18-5')
'XLYOFNOQVPJJNP-UHFFFAOYSA-N'
thermosteam.properties.identifiers.IUPAC_name(CASRN)[source]
>>> IUPAC_name('7732-18-5')
'oxidane'
thermosteam.properties.identifiers.name(CASRN)[source]
>>> name('7732-18-5')
'water'
thermosteam.properties.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']