cifkit.utils.string_parser module

cifkit.utils.string_parser.clean_parsed_structure(structure_type: str) str[source]

Split the parsed structure text and remove “~”.

cifkit.utils.string_parser.get_atom_type_from_label(site_label: str) str[source]

Return the element from the given label.

cifkit.utils.string_parser.get_string_to_formatted_float(str_value: str) float[source]

Remove parentheses from a value string and convert to float.

cifkit.utils.string_parser.strip_numbers_and_symbols(value: str) str[source]

Removes all digits and ‘+’ and ‘-’ characters from the input string.

Some ICSD, COD have charges in atomic site element e.g. “Fe0+”.

cifkit.utils.string_parser.trim_string(formula: str) str[source]

Remove “~”, “ “, and “’” characters from the parsed formula.