pymatgen.io.xyz module

class XYZ(mol, coord_precision=6)[source]

Bases: object

Basic class for importing and exporting Molecules or Structures in XYZ format.

Parameters:mol – Input molecule or list of molecules

Note

Exporting periodic structures in the XYZ format will lose information about the periodicity. Essentially, only cartesian coordinates are written in this format and no information is retained about the lattice.

all_molecules

Returns all the frames of molecule associated with this XYZ.

static from_file(filename)[source]

Creates XYZ object from a file.

Parameters:filename – XYZ filename
Returns:XYZ object
static from_string(contents)[source]

Creates XYZ object from a string.

Parameters:contents – String representing an XYZ file.
Returns:XYZ object
molecule

Returns molecule associated with this XYZ. In case multiple frame XYZ, returns the last frame.

write_file(filename)[source]

Writes XYZ to file.

Parameters:filename – File name of output file.