Metadata-Version: 2.4
Name: mmcif_parser
Version: 0.3.0
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Rust
Classifier: Topic :: Scientific/Engineering :: Bio-Informatics
Summary: Python bindings for the mmcif_parser Rust crates
Keywords: structural-biology,crystallography
Home-Page: https://github.com/chengjilai/mmcif_parser
Author: chengjilai
License: MIT
Requires-Python: >=3.9
Description-Content-Type: text/markdown; charset=UTF-8; variant=GFM
Project-URL: Homepage, https://github.com/chengjilai/mmcif_parser
Project-URL: Documentation, https://github.com/chengjilai/mmcif_parser/tree/main/docs
Project-URL: Repository, https://github.com/chengjilai/mmcif_parser
Project-URL: Issues, https://github.com/chengjilai/mmcif_parser/issues

# 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.

