Skip to main content

XYZ Format

Read and write whitespace-delimited XYZ coordinate tables (molecular or point clouds).

Overview

PropertyValue
Format idxyz
ClassXYZIterable
Extensions.xyz
Text formatYes
Flat rowsYes
ReadYes
WriteYes
Extranone (stdlib)

Record shape

Each data row yields:

{"element": "O", "x": 0.0, "y": 0.0, "z": 0.0}

Optional trailing fields become extra_0, extra_1, …. An optional atom-count header and comment line are skipped on read and written on write.

Usage

from iterable import open_iterable

with open_iterable("molecule.xyz") as source:
for row in source:
print(row["element"], row["x"], row["y"], row["z"])

See also