semvec/pypi-packages huggingface dataset:
mmcif_parser 0.3.0
Python bindings for the mmcif_parser Rust crates
License: MIT
Requires Python: >=3.9
Keywords: structural-biology, crystallography

# mmcif_parser 

> Looking for the repo overview? Check the [top-level README](../../README.md).
> 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.

```python
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:

    ```bash
    python3 -m venv .venv
    source .venv/bin/activate
    pip install maturin
    ```

2. Use the provided automation targets:

    ```bash
    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.