Chemfiles, a modern library for chemistry file reading and writing

Chemfiles is a multi-language library written in modern C++ for reading and writing from and to molecular trajectory files. These files are created by your favorite theoretical chemistry program, and contains informations about atomic or residues names and positions. Some format also have additional informations, such as velocities, forces, energy, …

The main targeted audience of chemfiles are chemistry researchers working on their own code to do some kind of awesome science, and who do not want to bother about handling all the files format that may exist in the world.

Running simulation (either Quantum Dynamic, Monte Carlo, Molecular Dynamic, or any other method) often produce enormous amounts of data, which had to be post-processed in order to extract informations. This post-processing step involve reading and parsing the data, and computing physical values with the help of statistical thermodynamic. Chemfiles tries to help you on the first point, by providing the same interface to all the trajectory formats. If you ever need to change your output format, your analysis tools will still work the same way. Chemfiles is efficient because it allow you to write and debug your code only once, and then to re-use it as needed.

Even if chemfiles is written in C++, it can be used from the most popular scientific programming languages: C, Fortran, Python, … You can just pick up your favorite language to use it. This part of the documentation presents the data model used by chemfiles to store information about the trajectories, and how to acess that data in C and C++. The documentation for the other languages interfaces to chemfiles are accessibles at the following places:


Chemfiles follow semantic versionning. This means that all 0.x.y versions are compatible for all y, but 0.x and 0.(x+1) are not compatible. This also means that when chemfiles reaches 1.0.0, all code using 1.0.0 will be compatible with 1.x.y for any x and y.