chematic-smiles — OpenSMILES parser, writer, and canonical SMILES generator.
Quick start
use ;
let mol = parse.unwrap; // benzene
assert_eq!;
assert_eq!;
// Non-canonical write (DFS order).
let smiles = write;
let mol2 = parse.unwrap;
assert_eq!;
// Canonical SMILES (stable, unique).
let c1 = canonical_smiles;
let c2 = canonical_smiles; // Kekule benzene
// c1 and c2 differ because aromaticity differs, but both are stable.
assert_eq!;
Design
- Pure Rust: no C/C++ FFI, no unsafe.
- Single-pass recursive-descent parser; no separate lexer phase.
- WASM-compatible (no filesystem I/O, no threads).