Python interface reference¶
The Python interface is exposed in the
chemfiles module, and this page
list all the classes and methods in this module.
Chemfiles uses exceptions for error handling, throwing
ChemfilesError when an
Exception class for errors in chemfiles
Warnings from the Chemfiles runtime.
FormatMetadatacontains metadata associated with one format. The following fields are directly accessible:
name (str) – name of the format
extension (str) – extension associated with the format, or
Noneif there is no extension associated with this format
description (str) – extended user-facing description of the format
reference (str) – extended user-facing description of the format
read (bool) – is reading files in this format implemented?
write (bool) – is writing files in this format implemented?
memory (bool) – does this format support in-memory IO?
positions (bool) – does this format support storing atomic positions?
velocities (bool) – does this format support storing atomic velocities?
unit_cell (bool) – does this format support storing unit cell information?
atoms (bool) – does this format support storing atom names or types?
bonds (bool) – does this format support storing bonds between atoms?
residues (bool) – does this format support storing residues?
Read configuration data from the file at
By default, chemfiles reads configuration from any file name .chemfilesrc in the current directory or any parent directory. This function can be used to add data from another configuration file.
This function will fail if there is no file at
path, or if the file is incorrectly formatted. Data from the new configuration file will overwrite any existing data.
Get the list of formats known by chemfiles, as well as all associated metadata.
- Return type
Call function on every warning event. The callback should take a string message and return nothing.
By default, warnings are send to python warnings module.