Python bindings for the mmcif_parser Rust crates
Project description
mmcif_parser (Python bindings)
Looking for the repo overview? Check the top-level README. The details below cover the PyO3 binding specifically.
Python wheels generated from the mmcif_core and mmcif_analyze Rust crates. The
extension module exposes a high-level Structure type that mirrors the Rust data
model and offers convenience helpers for spatial queries.
from pathlib import Path
import mmcif_parser as mmcif
structure = mmcif.parse(Path("11AS.cif.gz"))
print(structure.atom_count)
for hit in structure.nearest_atoms((12.0, 4.2, 0.3), max_distance=5.0, max_results=5):
print(hit.index, hit.distance)
Building
-
Create a virtual environment and install maturin once:
python3 -m venv .venv source .venv/bin/activate pip install maturin
-
Use the provided automation targets:
cd python/mmcif_parser_py make develop # editable install via maturin develop --release make build # produce wheels + sdist via maturin build --release --sdist --strip
make distclean removes the build artifacts and uninstalls the editable package
from the virtual environment, while make clean only clears the local target
and egg-info directories.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file mmcif_parser-0.2.0-cp39-abi3-manylinux_2_34_x86_64.whl.
File metadata
- Download URL: mmcif_parser-0.2.0-cp39-abi3-manylinux_2_34_x86_64.whl
- Upload date:
- Size: 360.8 kB
- Tags: CPython 3.9+, manylinux: glibc 2.34+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.9.11 {"installer":{"name":"uv","version":"0.9.11"},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Arch Linux","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
97f6185cbe83274487c94ecd575eb15c81a02ab83b3eb03df3203b171ab12035
|
|
| MD5 |
191c23f23b774d85fedb9f6fd35b7d67
|
|
| BLAKE2b-256 |
88c9b7ffdc320fc91947eb350cdc4b338e8f79d88f0d92681754cedd82da758d
|