Skip to main content

mmcif_parser

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

  1. Create a virtual environment and install maturin once:

    python3 -m venv .venv
    source .venv/bin/activate
    pip install maturin
    
  2. 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.

Metadata

Release files for mmcif_parser 0.3.0

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

Built distribution (wheel)

Table of built distributions (wheels) for mmcif_parser 0.3.0
File Interpreter ABI Platform
mmcif_parser-0.3.0-cp39-abi3-manylinux_2_34_x86_64.whl CPython 3.9 abi3 Linux glibc 2.34+ x86-64 Details

Release files / mmcif_parser-0.3.0-cp39-abi3-manylinux_2_34_x86_64.whl

Download URL mmcif_parser-0.3.0-cp39-abi3-manylinux_2_34_x86_64.whl
Size 360.8 kB
Tags CPython 3.9 Linux glibc 2.34+ x86-64 abi3
SHA-256 checksum
How to use checksums
0e2b17301fc12303e03c0b6b8473182eaaa69915f1e732b4bf6e9c07454f4212
BLAKE2b-256 checksum
How to use checksums
d20da54137a0fa8b05f772f914a2099b6175b242e423c14770d0710ee9ad5cac
Upload date
Uploaded using Trusted Publishing?
What is 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}

Release history Release notifications | RSS feed

This release

0.3.0 This release

1 release file

0.2.0

1 release file

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