Skip to main content

Python binding for the chemfiles library

Build Status Code coverage Documentation

Chemfiles is a library for reading and writing molecular trajectory files. These files are created by your favorite theoretical chemistry program, and contains information about atomic or residues names and positions. Chemfiles offers abstraction on top of these formats, and a consistent interface for loading and saving data to these files.

This repository contains the Python binding for the chemfiles library. This binding is created with the ctypes module, calling directly the C interface of chemfiles, and thus is compatible with Python 2 and 3, and with all versions of Numpy.

Installation

You can use your favorite package manager (conda or pip) to install pre-built versions of Chemfiles, that support Linux/Windows/macOS, and Python 2.7 and 3.

# Using pip
pip install chemfiles
# Using conda
conda install -c conda-forge chemfiles

Source compilation

You can install this python module from sources if you have all the dependencies of the C++ chemfiles library installed on your computer.

# To get the latest development version:
git clone https://github.com/chemfiles/chemfiles.py
cd chemfiles.py
git submodule update --init
# Install development dependencies
pip install -r dev-requirements.txt
# Install chemfiles
pip install .
# Optionally run the test suite
tox

Usage example

Here is a simple usage example for the chemfiles module. Please see the examples folder for more examples.

from chemfiles import Trajectory, Frame

trajectory = Trajectory("filename.xyz")
frame = trajectory.read()

print(f"There are {len(frame.atoms)} atoms in the frame")
positions = frame.positions()

# Do awesome things with the positions here !

Bug reports, feature requests

Please report any bug you find and any feature you may want as a github issue.

Metadata

Release files for chemfiles 0.10.4

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for chemfiles 0.10.4
File Size Uploaded
chemfiles-0.10.4.tar.gz 3.6 MB Details

Built distributions (wheels)

Table of built distributions (wheels) for chemfiles 0.10.4
File
chemfiles-0.10.4-py2.py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl Python 3, Python 2 none Linux glibc 2.17+ x86-64 Details
chemfiles-0.10.4-py2.py3-none-manylinux_2_17_i686.manylinux2014_i686.whl Python 2, Python 3 none Linux glibc 2.17+ x86-32 Details
chemfiles-0.10.4-py2.py3-none-macosx_11_0_arm64.whl Python 2, Python 3 none macOS 11.0+ ARM64 Details
chemfiles-0.10.4-py2.py3-none-macosx_10_9_x86_64.whl Python 3, Python 2 none macOS 10.9+ x86-64 Details
chemfiles-0.10.4-1-py2.py3-none-win_amd64.whl Python 2, Python 3 none Windows x86-64 Details

Total release size: 10.9 MB

Release files / chemfiles-0.10.4.tar.gz

Download URL chemfiles-0.10.4.tar.gz
Size 3.6 MB
Tags Source
SHA-256 checksum
How to use checksums
f9e5ece3fcc8b63fdc2708d4ecc2ba5862ae2ab6790447bffc10c1b34ef2f445
BLAKE2b-256 checksum
How to use checksums
c25135538663b6384add778945735478da66b7c3095649654325d001922f30f8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.10.11

Release files / chemfiles-0.10.4-py2.py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl

Download URL chemfiles-0.10.4-py2.py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Size 1.6 MB
Tags Linux glibc 2.17+ x86-64 Python 2 Python 3
SHA-256 checksum
How to use checksums
ef8f2b9fa65885658088180bb33971d1337bc8542220c710d1f6f3c1a6d661d4
BLAKE2b-256 checksum
How to use checksums
504c380de5755146e27236cdecf02b7fe5da4c1f3786716baee5b3a245026acb
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.10.11

Release files / chemfiles-0.10.4-py2.py3-none-manylinux_2_17_i686.manylinux2014_i686.whl

Download URL chemfiles-0.10.4-py2.py3-none-manylinux_2_17_i686.manylinux2014_i686.whl
Size 1.8 MB
Tags Linux glibc 2.17+ x86-32 Python 2 Python 3
SHA-256 checksum
How to use checksums
4dbf6fa7ad5b2a1ad1415fbca905ce3a02c71cc2aa7fbce18a2b7d13c01a3664
BLAKE2b-256 checksum
How to use checksums
3ad5beb71f372e650ba75e3eac246a17daa09a08aeed46580b62af35234d01f2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.10.11

Release files / chemfiles-0.10.4-py2.py3-none-macosx_11_0_arm64.whl

Download URL chemfiles-0.10.4-py2.py3-none-macosx_11_0_arm64.whl
Size 1.4 MB
Tags Python 2 Python 3 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
626725b0ea907d995cbbba99df1d19c474f8ebecdea8d0d390b7f3eaf2c91039
BLAKE2b-256 checksum
How to use checksums
785fd7d7347db0d1a92577aa27d9412adea002295263d52cca57ff14c92cde56
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.10.11

Release files / chemfiles-0.10.4-py2.py3-none-macosx_10_9_x86_64.whl

Download URL chemfiles-0.10.4-py2.py3-none-macosx_10_9_x86_64.whl
Size 1.5 MB
Tags Python 2 Python 3 macOS 10.9+ x86-64
SHA-256 checksum
How to use checksums
10a4e641605db56321316310f620746db350691d7c9edc433fe2a65984e2278b
BLAKE2b-256 checksum
How to use checksums
840e409d1fe39dc24f3ac47dd384e78462fc4eb0435a169afe5b488cf6ded39b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.10.11

Release files / chemfiles-0.10.4-1-py2.py3-none-win_amd64.whl

Download URL chemfiles-0.10.4-1-py2.py3-none-win_amd64.whl
Size 1.1 MB
Tags Python 2 Python 3 Windows x86-64
SHA-256 checksum
How to use checksums
5c1b50a7fd56d014f930e38a838c92098bd047a3e989ba4b89ff657c6d16e38a
BLAKE2b-256 checksum
How to use checksums
8b0de5a214dddec845c425cda2cb2273a95b2c5f77be9404d02c4f48b4e6992b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.10.11

Release history Release notifications | RSS feed

This release

0.10.4 This release

6 release files

0.10.3

5 release files

0.10.2

7 release files

0.10.1

6 release files

0.9.3

6 release files

0.9.2

6 release files

0.9.1

6 release files

0.8.0

6 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page