orthonym.data.ion_retained_names#
Note
Internal API. Names and behaviour may change between releases.
Retained names for common ions used in IUPAC nomenclature.
This module provides lookup tables for common organic and inorganic ions that have retained (trivial) names preferred over systematic names.
For salts, the naming convention is: cation name + anion name Example: sodium acetate, potassium chloride
Keys are canonical SMILES (verified with RDKit canonicalization).
- orthonym.data.ion_retained_names.get_anion_name(smiles, pin=False)#
Look up retained name for an anion by its SMILES.
The input SMILES is canonicalized before lookup to ensure consistent matching regardless of input format.
- Parameters:
smiles (str) – SMILES string (will be canonicalized)
- Returns:
Retained name if found, None otherwise
- Return type:
str | None
Example
>>> get_anion_name('CC(=O)[O-]') 'acetate' >>> get_anion_name('[Cl-]') 'chloride'
- orthonym.data.ion_retained_names.get_cation_name(smiles)#
Look up retained name for a cation by its SMILES.
The input SMILES is canonicalized before lookup to ensure consistent matching regardless of input format.
- Parameters:
smiles (str) – SMILES string (will be canonicalized)
- Returns:
Retained name if found, None otherwise
- Return type:
str | None
Example
>>> get_cation_name('[NH4+]') 'azanium' >>> get_cation_name('[Na+]') 'sodium'
- orthonym.data.ion_retained_names.get_ion_name(smiles)#
Look up retained name for any ion (cation or anion).
Convenience function that checks both cation and anion lookups.
- Parameters:
smiles (str) – SMILES string (will be canonicalized)
- Returns:
Retained name if found, None otherwise
- Return type:
str | None
Example
>>> get_ion_name('[Na+]') 'sodium' >>> get_ion_name('[Cl-]') 'chloride'