Skip to content

Install

molpack ships three surfaces — the CLI binary, the Rust crate, and the Python binding. Pick the one that matches your workflow; they share the same engine and packing model.

CLI

For Packmol-style .inp scripts:

cargo install molcrafts-molpack --features cli
molpack --help

Path resolution

In file-arg mode (molpack job.inp), relative paths inside the script are resolved against the script directory. In stdin mode they resolve against the current working directory.

Rust crate

For programmatic use from Rust:

cargo add molcrafts-molpack

Optional features (crate defaults to none enabled):

Feature Purpose
cli molpack binary + clap (implies io)
io PDB / XYZ / SDF / LAMMPS readers via molrs
rayon Parallel objective evaluation
ff Force-field geometry relaxer (MMFF + L-BFGS)
# Cargo.toml — common combinations
molcrafts-molpack = { version = "0.2", features = ["io", "rayon"] }

Python binding

For notebooks and pipelines (Python 3.12+):

pip install molcrafts-molpack

molcrafts-molrs is installed as a dependency and provides molrs.Frame plus PDB / XYZ readers. The wheel itself is I/O-free — pass frames in, get frames out.

import molpack
print(molpack.Molpack)

Pre-built wheels

Wheels are published for CPython 3.12 and 3.13 on Linux (manylinux x86-64) and macOS (universal2). Other platforms fall back to the sdist and need a Rust toolchain to build.

Build from source

When you are modifying the crate or Python binding, check out molrs as a sibling (path deps resolve ../molrs/molrs):

# sibling layout
# workspace/
# ├── molrs/
# └── molpack/

git clone https://github.com/MolCrafts/molpack
cd molpack

# Rust library + CLI
cargo build --features cli

# Python wheel (editable)
cd python && maturin develop --release

See Development for tests, hooks, and contribution workflow.