Skip to main content

CIF Format

Read Crystallographic Information File (CIF) _atom_site loop rows as flat dictionaries.

Overview

PropertyValue
Format idcif
ClassCIFIterable
Extensions.cif
ReadYes
WriteNo
Extranone (stdlib)
Maturityexperimental

Record shape

Column names are stripped of the _atom_site. prefix:

{"type_symbol": "O", "label_atom_id": "O1", "Cartn_x": 0.0, "Cartn_y": 0.0, "Cartn_z": 0.0}

Only loop_ blocks whose columns all start with _atom_site. are yielded. . / ? become None; numeric fields are coerced when possible.

Usage

from iterable import open_iterable

with open_iterable("structure.cif") as source:
for atom in source:
print(atom["type_symbol"], atom["Cartn_x"], atom["Cartn_y"], atom["Cartn_z"])

See also