Skip to content

Releases: HFooladi/sdfrust

v0.6.0

19 Feb 15:31

Choose a tag to compare

v0.5.0

17 Feb 15:05

Choose a tag to compare

Full Changelog: v0.4.0...v0.5.0

v0.4.0 - Python Bindings

30 Jan 13:48

Choose a tag to compare

What's New

Python Bindings (sdfrust-python/ crate)

  • PyO3-based Python bindings with full API coverage
  • PyAtom, PyBond, PyBondOrder, PyBondStereo wrapper classes
  • PyMolecule with all properties and descriptor methods
  • SDF V2000/V3000 parsing and writing functions
  • MOL2 parsing functions
  • Memory-efficient streaming iterators (iter_sdf_file, iter_mol2_file)
  • NumPy integration for coordinate arrays (get_coords_array, set_coords_array)
  • 33 pytest tests covering all functionality

Installation

# From source (requires Rust toolchain)
cd sdfrust-python
pip install maturin
maturin develop --features numpy

Example Usage

import sdfrust

# Parse molecules
mol = sdfrust.parse_sdf_file("molecule.sdf")
print(f"{mol.name}: MW={mol.molecular_weight():.2f}")

# NumPy integration
coords = mol.get_coords_array()  # (N, 3) array

# Iterate over large files
for mol in sdfrust.iter_sdf_file("large.sdf"):
    process(mol)

Full Changelog: v0.3.0...v0.4.0