Skip to main content

MolCrysKit: Molecular Crystal Toolkit

License: MIT Python Version PyPI unit-tests

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
  • Cluster Carving: Disorder resolution → desolvation → coordination-shell cluster extraction
  • LLM-based AI agent Friendliness: Try on https://matmaster.bohrium.com/matmaster or build your own skill for your agent


Molecule Identification


Disorder Handling


Topological Surface Generation


Hydrogen Completion


Cluster Carving

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.

Docker / Cloud

See Docker Guide for local Docker, Bohrium cloud deployment, and GHCR image publication.

Command Line Interface

Installing MolCrysKit also installs the mck command. The CLI is self-documenting; use --help at any level to see the exact arguments for your installed version:

mck --help
mck io --help
mck operate --help
mck analyze --help
mck operate cluster --help

The command groups roughly mirror the Python package layout:

  • mck io ... — summarize, inspect molecules, extract molecules, and convert structures (info, molecules, extract-molecule, convert).
  • mck operate ... — generate modified structures (disorder, add-h, slab, cluster, supercell, vacancy, desolvate, interpolate).
  • mck analyze ... — print analysis reports (bfdh, interactions, polyhedra).

Documentation

You are… Start here
Using the library API & Capabilities · Tutorials
AI agent (using the library) API & Capabilities — read "Capability Map" then "Module Index"
AI agent (modifying code) AGENTS.md · Architecture
Docker / cloud Docker Guide

molcrys_kit/ — source code · scripts/ — diagnostic utilities · examples/ — CIF structure files

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

molcrys_kit-0.6.0.tar.gz (5.7 MB view details)

Uploaded Source

Built Distribution

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

molcrys_kit-0.6.0-py3-none-any.whl (300.6 kB view details)

Uploaded Python 3

File details

Details for the file molcrys_kit-0.6.0.tar.gz.

File metadata

  • Download URL: molcrys_kit-0.6.0.tar.gz
  • Upload date:
  • Size: 5.7 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.14

File hashes

Hashes for molcrys_kit-0.6.0.tar.gz
Algorithm Hash digest
SHA256 25b01151a050c0ed7d424a39a99e17ae567a3cc0baa8a95afac8a090c954af9c
MD5 b935abf20d33c5b4b964616ee248854c
BLAKE2b-256 f043749969c57d90d3a56679dd7016d683fbe73f9b3a6ee4e879a879570bd0f6

See more details on using hashes here.

Provenance

The following attestation bundles were made for molcrys_kit-0.6.0.tar.gz:

Publisher: release.yml on SchrodingersCattt/MolCrysKit

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file molcrys_kit-0.6.0-py3-none-any.whl.

File metadata

  • Download URL: molcrys_kit-0.6.0-py3-none-any.whl
  • Upload date:
  • Size: 300.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.14

File hashes

Hashes for molcrys_kit-0.6.0-py3-none-any.whl
Algorithm Hash digest
SHA256 feb91f358058a6e7c8c058e129a9e17c83b614b8931a4ebf4ae103a002760a24
MD5 acf592a9e85824560fbaf81e796d2245
BLAKE2b-256 9918c8ee23e715c1323b10b7c408d962bb8c25e8a60abbad3261fd3c4289c86d

See more details on using hashes here.

Provenance

The following attestation bundles were made for molcrys_kit-0.6.0-py3-none-any.whl:

Publisher: release.yml on SchrodingersCattt/MolCrysKit

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Release history Release notifications | RSS feed

0.7.1

2 files

0.7.0

2 files

0.6.1

2 files

This release

0.6.0 This release

2 files

0.5.2

2 files

0.5.1

2 files

0.5.0

2 files

0.4.0

2 files

0.3.0

2 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page