orsopy.utils.chemical_formula module

A simple class to resolve and store chemical formula strings.

class orsopy.utils.chemical_formula.Formula(string, sort=True)[source]

Bases: list

Evaluate strings for element chemical formula.

elements = 'A[cglmrstu]|B[aehikr]?|C[adeflmorsu]?|D[bsy]{0,1}|E[rsu]|F[emr]?|G[ade]|H[efgosx]?|I[nr]?|Kr?|L[airu]|M[dgnot]|N[abdeiop]?|Os?|P[abdmortu]?|R[abefghnu]|S[bcegimnr]?|T[abcehilm]|Uu[bhopqst]|U|V|W|Xe|Yb?|Z[nr]'
isotopes = '(A[cglmrstu]|B[aehikr]?|C[adeflmorsu]?|D[bsy]{0,1}|E[rsu]|F[emr]?|G[ade]|H[efgos]?|I[nr]?|Kr?|L[airu]|M[dgnot]|N[abdeiop]?|Os?|P[abdmortu]?|R[abefghnu]|S[bcegimnr]?|T[abcehilm]|Uu[bhopqst]|U|V|W|Xe|Yb?|Z[nr])\\[[1-9][0-9]{0,2}\\]'
parse_string(string)[source]
static split_groups(string)[source]
parse_group(group, case_sensitive=True)[source]
merge_same()[source]
index(item, **kwargs)[source]

Return first index of value.

Raises ValueError if the value is not present.