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

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.

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.

write_file(filename)[source]

Writes XYZ to file.

Parameters:filename – File name of output file.