MolCrysKit: Molecular Crystal Toolkit
Overview
MolCrysKit is a Python toolkit designed for handling molecular crystals, providing utilities for parsing crystallographic data, identifying molecules within crystals, and performing various analyses on molecular crystals using graph theory and the Atomic Simulation Environment (ASE).
Key Features
- Robust Molecule Identification: Identify individual molecules within a crystal structure using graph-based algorithms
- Disorder Handling: Process disordered structures with graph algorithms
- Topological Surface Generation: Create surface slabs while preserving molecular topology
- Hydrogen Completion: Add hydrogen atoms with heuristic geometric placement rules
Installation
From PyPI (recommended)
pip install molcrys-kit
From source (development)
git clone https://github.com/SchrodingersCattt/MolCrysKit.git
cd MolCrysKit
pip install -e ".[dev]"
All dependencies are declared in pyproject.toml (there is no separate
requirements.txt). requires-python = ">=3.10". The available extras are:
| Extra | Adds |
|---|---|
[test] |
pytest, pytest-cov |
[vis] |
nglview, py3Dmol for 3-D visualisation in notebooks |
[dev] |
[test] + [vis] + build, ruff>=0.15, pre-commit, nbstripout, twine |
So a contributor environment is pip install -e ".[dev]" and a CI / minimal
test environment is pip install -e ".[test]".
Quick Start
Here's a simple example of how to use MolCrysKit:
import molcrys_kit as mck
from ase import Atoms
# 1. Create a toy system (e.g., 2 Water molecules in a unit cell)
# In practice, you would typically load this from a file: atoms = read('cif_file.cif')
atoms = Atoms(
symbols=['O', 'H', 'H', 'O', 'H', 'H'],
positions=[
[1.0, 1.0, 1.0], [1.8, 1.0, 1.0], [0.7, 1.6, 1.0], # Molecule 1
[5.0, 5.0, 5.0], [5.8, 5.0, 5.0], [4.7, 5.6, 5.0] # Molecule 2
],
cell=[10.0, 10.0, 10.0],
pbc=True
)
# 2. Initialize MolecularCrystal (Automatically identifies molecules via graph logic)
crystal = mck.MolecularCrystal.from_ase(atoms)
# 3. Access Crystal & Molecular Properties
print(f"Lattice Parameters: {crystal.get_lattice_parameters()}")
print(f"Identified Molecules: {len(crystal.molecules)}")
mol = crystal.molecules[0]
print(f"Molecule 1 Formula: {mol.get_chemical_formula()}")
print(f"Molecule 1 Center of Mass: {mol.get_center_of_mass()}")
Citation
If you use MolCrysKit in academic work, please cite:
Guo, M.-Y.; Zhang, W.-X. MolCrysKit: A Topology-Aware Toolkit for Bridging Experimental Molecular-Crystal Structures and Simulation-Ready Modeling. J. Chem. Inf. Model. 2026, 66 (9), 4999-5007. https://doi.org/10.1021/acs.jcim.6c00168
For exact reproduction of the published JCIM results, use the archived
v0.1.0 release together with the versioned container image and the material
under paper/. The main branch may continue to evolve after publication.
Running with Docker
Two Dockerfiles are provided: Dockerfile (python:3.10-slim) for local use and
Dockerfile.bohrium for the Bohrium cloud platform. Both install MolCrysKit
from the GitHub archive.
git clone https://github.com/SchrodingersCattt/MolCrysKit.git
cd MolCrysKit
docker build -t molcryskit:latest .
docker run --rm molcryskit:latest python /opt/molcryskit/scripts/docker_smoke_test.py
docker run -it --rm -p 8888:8888 molcryskit:latest # Jupyter
For Bohrium deployment, GHCR image publication, and mounting custom data, see the Docker Guide.
Documentation
Disorder Handling
MolCrysKit resolves crystallographic disorder through two complementary paths:
the explicit path processes CIF _atom_site_disorder_assembly / _disorder_group
tags (e.g. SHELXL PART groups), while the implicit SP path handles
partial-occupancy atoms on special positions without disorder tags (SHELX
riding-H refinements). A motif-merge post-pass reconstructs isolated XH_n
centres (NH4+, H2O), and three replica-generation modes (optimal, random,
enumerate) support downstream ensemble workflows. Valence-completeness
diagnostics flag incomplete H-shells automatically.
For the full three-phase pipeline, edge-type priority table, solver modes, and symmetry-copy decoupling details, see Architecture.
Documentation Index
| Document | Covers |
|---|---|
| Architecture | Core philosophy, disorder solver pipeline, edge types, solver modes |
| Tutorials | Hydrogen completion, surface slabs, BFDH facets, cluster carving, molecule manipulation |
| API Reference | Key classes and functions by module |
| Docker Guide | Docker quick start, Bohrium cloud, GHCR archival, mounting data |
Project Structure
See the molcrys_kit/ directory for source code and the scripts/ directory for utility scripts (e.g. disorder diagnostics, molecule identification, CIF processing).
Contributing
Contributions are welcome! Please fork the repository and submit a pull request.
License
This project is licensed under the MIT License - see the LICENSE file for details.
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file molcrys_kit-0.5.0.tar.gz.
File metadata
- Download URL: molcrys_kit-0.5.0.tar.gz
- Upload date:
- Size: 4.2 MB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a3ba89ee6b60532b2f0900dd6b4258719174da6c171590e2b2084bba139665b3
|
|
| MD5 |
acb118eb257ab824a40136cf5dc6d258
|
|
| BLAKE2b-256 |
fea89a51eef6f83a8e9ff7c6da84011ab4fb39f0363a234d462dd1c80b3fd597
|
Provenance
The following attestation bundles were made for molcrys_kit-0.5.0.tar.gz:
Publisher:
release.yml on SchrodingersCattt/MolCrysKit
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
molcrys_kit-0.5.0.tar.gz -
Subject digest:
a3ba89ee6b60532b2f0900dd6b4258719174da6c171590e2b2084bba139665b3 - Sigstore transparency entry: 1924715014
- Sigstore integration time:
-
Permalink:
SchrodingersCattt/MolCrysKit@c292e5cca37f14b3a45b7c629bd653a05b551c70 -
Branch / Tag:
refs/tags/v0.5.0 - Owner: https://github.com/SchrodingersCattt
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@c292e5cca37f14b3a45b7c629bd653a05b551c70 -
Trigger Event:
push
-
Statement type:
File details
Details for the file molcrys_kit-0.5.0-py3-none-any.whl.
File metadata
- Download URL: molcrys_kit-0.5.0-py3-none-any.whl
- Upload date:
- Size: 256.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
72e836b31bbc2640f10c9daebbad7cd314792e2edf2848d38d2bbd3fde1bd42e
|
|
| MD5 |
069c37a10d10c2a17b5baf9a683d62cc
|
|
| BLAKE2b-256 |
9d3934349ccb9f0f849a687c97a12f01d7b0dcf20423387aa0a21725378200dc
|
Provenance
The following attestation bundles were made for molcrys_kit-0.5.0-py3-none-any.whl:
Publisher:
release.yml on SchrodingersCattt/MolCrysKit
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
molcrys_kit-0.5.0-py3-none-any.whl -
Subject digest:
72e836b31bbc2640f10c9daebbad7cd314792e2edf2848d38d2bbd3fde1bd42e - Sigstore transparency entry: 1924715232
- Sigstore integration time:
-
Permalink:
SchrodingersCattt/MolCrysKit@c292e5cca37f14b3a45b7c629bd653a05b551c70 -
Branch / Tag:
refs/tags/v0.5.0 - Owner: https://github.com/SchrodingersCattt
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@c292e5cca37f14b3a45b7c629bd653a05b551c70 -
Trigger Event:
push
-
Statement type: