Skip to main content

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

  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.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

mmcif_parser-0.2.0-cp39-abi3-manylinux_2_34_x86_64.whl (360.8 kB view details)

Uploaded CPython 3.9+manylinux: glibc 2.34+ x86-64

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

Hashes for mmcif_parser-0.2.0-cp39-abi3-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 97f6185cbe83274487c94ecd575eb15c81a02ab83b3eb03df3203b171ab12035
MD5 191c23f23b774d85fedb9f6fd35b7d67
BLAKE2b-256 88c9b7ffdc320fc91947eb350cdc4b338e8f79d88f0d92681754cedd82da758d

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page