chemistry_tools.formulae.compound
Attention
This module has the following additional requirements:
cawdrey>=0.5.0 mathematical>=0.5.1 pyparsing>=2.4.6 tabulate>=0.8.9
These can be installed as follows:
python -m pip install chemistry-tools[formulae]
Parse formulae into a Python object.
Classes:
|
Class representing a chemical compound. |
-
class
Compound(name, formula=None, data=None, latex_name=None, unicode_name=None, html_name=None)[source] Bases:
DictableClass representing a chemical compound.
- Parameters
datacould be simple such as{'mp': 0, 'bp': 100}or considerably more involved, e.g.:{ 'diffusion_coefficient': { 'water': lambda T: 2.1*m**2/s/K*(T - 273.15*K), } }
Methods:
__eq__(other)Return
self == other.__repr__()Return a string representation of the
Compound.__str__()Return
str(self).Returns the molar mass (with units) of the substance.
Attributes:
The charge of the compound.
The mass of the compound.