Python helpers for handling chemical formulas.