Skip to content

File input and output

Use atomli.io.read and atomli.io.write for supported structure formats.

from atomli.io import read
atoms = read("structure.xyz")
from atomli.io import write
write("optimized.xyz", atoms)

The file suffix usually selects the format. When a format cannot represent a property, do not assume that property will survive a round trip. Verify the cell, periodicity, arrays, and constraints that matter to your workflow.