chematic 1.0.13

A pure-Rust cheminformatics toolkit: SMILES/SMARTS, SDF/MOL V3000, ECFP/MACCS fingerprints, LogP/TPSA/QED, CIP stereo, MCS, 2D SVG depiction — no C/C++ dependencies, runs in the browser via WebAssembly.
Documentation

chematic

CI PyPI crates.io npm License

Cheminformatics for Python, Rust, and the browser. chematic is built in pure Rust, with bounded input handling, typed errors, and optional native InChI.

日本語 · 中文 · Documentation · Live demo

Install

pip install chematic
cargo add chematic --features "smiles,perception,chem,3d,fp"
npm install @kent-tokyo/chematic

Python needs no C/C++ compiler. Rust and WebAssembly builds use the same core.

v1.0.13 release boundary

This release records expanded reaction, V3000, parser-safety, CIP, and cross-binding validation. RDKit-compatible fingerprints, Markush/polymer semantics, and browser artifact parity remain bounded; see the compatibility scope and CHANGELOG.

Python

import chematic

mol = chematic.from_smiles("CC(=O)Oc1ccccc1C(=O)O")
print(mol.mw, mol.logp, mol.tpsa)
print(mol.has_substructure("[OH]"))

report = chematic.report([mol], names=["aspirin"])
report.save("report.html")

For a small RDKit-compatible subset:

from chematic import rdkit_compat as Chem
from chematic.rdkit_compat import Descriptors

mol = Chem.MolFromSmiles("CCO")
print(Descriptors.MolWt(mol))

This is not a full RDKit clone. Unsupported options fail explicitly; see the migration guide.

Rust

use chematic::smiles::parse;

let mol = parse("c1ccccc1")?;
println!("{}", mol.atom_count());
# Ok::<(), Box<dyn std::error::Error>>(())

The workspace also contains focused crates for SMILES/SMARTS, descriptors, fingerprints, reactions, SDF/MOL/CDXML, 2D/3D, crystal formats, MCP, and bindings. See the format matrix.

JavaScript / WebAssembly

import init, { parse_smiles, get_descriptors_json } from "@kent-tokyo/chematic";

await init();
const mol = parse_smiles("CCO");
console.log(mol.atom_count());
console.log(JSON.parse(get_descriptors_json(mol)));

The WASM package supports molecule parsing, descriptors, fingerprints, reactions, selected 2D/3D operations, and format conversion. The current export surface is documented in the WASM README.

What is stable

  • SMILES and SMARTS parsing/writing
  • Descriptors, fingerprints, Tanimoto similarity, and substructure search
  • SDF/MOL V2000/V3000 and selected chemical formats
  • Python, Node/WASM, and Rust bindings
  • Bounded parsing, typed failures, and deterministic batch APIs

Experimental or intentionally bounded areas include 3D generation, pKa/ADMET screening, IUPAC names, Markush/polymer expansion, CDXML editing, and the RDKit-compatible subset. Canonical SMILES is not always a safe deduplication key; use the fail-closed canonical_smiles_stable_key() API where required.

See compatibility scope, validation, and error and resource limits for exact guarantees.

For research software users

Use the researcher guide for a short path from installation to a reproducible result. It explains which APIs are stable, which comparisons are version- and corpus-pinned, how unsupported cases are reported, and how to cite a specific release. The benchmark index keeps performance claims separate from correctness and compatibility evidence.

MCP server

chematic-mcp provides local chemistry tools over stdio for MCP-compatible agents. It performs no network access except for the optional name lookup tool. See its README.

Development

cargo build --workspace
cargo test --workspace --all-targets --locked
cargo clippy --workspace --all-targets --locked -- -D warnings

Benchmark methodology and dated results are kept in docs/benchmark.md and benchmarks/. Release history is in CHANGELOG.md.

License

Licensed under either Apache License 2.0 or MIT, at your option. See NOTICE for attribution details.