Skip to main content

High-performance cheminformatics library - Python bindings for cchem

Project description

pycchem

Python bindings for cchem - a high-performance cheminformatics library.

Features

  • Fast SMILES canonicalization - 2-3x faster than RDKit
  • 1600+ molecular descriptors - Comprehensive descriptor set
  • Molecular sanitization - Salt removal, neutralization, aromatization
  • Pure C backend - No heavy dependencies

Installation

pip install pycchem

From Source

git clone https://github.com/Vitruves/cchem.git
cd cchem/pycchem
pip install .

Quick Start

Canonicalization

import pycchem

# Canonicalize a SMILES
canon = pycchem.canonicalize("C(C)O")
print(canon)  # CCO

# Check if two SMILES are equivalent
pycchem.are_equivalent("CCO", "OCC")  # True

# Validate SMILES
pycchem.validate("CCO")  # True
pycchem.validate("invalid")  # False

Sanitization

import pycchem

# Remove salts and neutralize
clean = pycchem.sanitize("[Na+].CC(=O)[O-]")
print(clean)  # CC(=O)O

# Specific operations
pycchem.sanitize("C1=CC=CC=C1", operations=["aromatize"])  # c1ccccc1

Molecular Descriptors

import pycchem

# Create a molecule
mol = pycchem.Molecule("CCO")

# Compute all descriptors (1600+)
descriptors = mol.descriptors()
print(descriptors["MolecularWeight"])  # 46.069
print(descriptors["CarbonCount"])  # 2

# Compute specific descriptors
selected = mol.descriptors(["MolecularWeight", "WCLogP", "TPSA"])

# List available descriptors
names = pycchem.list_descriptors()
print(len(names))  # ~1600

Batch Processing

import pycchem

smiles_list = ["CCO", "c1ccccc1", "CC(=O)O"]
results = pycchem.canonicalize_batch(smiles_list)

Command-Line Interface

After installation, the cchem command is available:

# Canonicalize SMILES
cchem canonicalize -S "C(C)O"
# Output: CCO

# Validate SMILES
cchem validate -S "CCO"
# Output: CCO: valid

# Compute descriptors
cchem compute -S "CCO" -d MolecularWeight
# Output: MolecularWeight: 46.069000

# Compute all descriptors
cchem compute -S "CCO" --all -o descriptors.csv

# List available descriptors
cchem compute --list

# Sanitize SMILES
cchem sanitize -S "[Na+].CC(=O)[O-]"
# Output: CC(=O)O

# Compare two SMILES
cchem compare "CCO" "OCC"
# Output: equivalent

# Show version
cchem --version

CLI Commands

Command Description
canonicalize Canonicalize SMILES strings
validate Validate SMILES syntax
compute Compute molecular descriptors
sanitize Sanitize SMILES (remove salts, neutralize, etc.)
compare Check if two SMILES are equivalent

API Reference

Functions

Function Description
canonicalize(smiles) Canonicalize SMILES string
canonicalize_batch(list) Batch canonicalization
sanitize(smiles, operations) Sanitize molecule
validate(smiles) Check SMILES validity
are_equivalent(s1, s2) Check if SMILES are equivalent
compute_descriptor(smiles, name) Compute single descriptor
compute_descriptors(smiles, names) Compute multiple descriptors
list_descriptors() List all descriptor names
version() Get library version

Molecule Class

mol = pycchem.Molecule(smiles)
mol.canonical_smiles  # Canonical form
mol.descriptors()     # All descriptors
mol.descriptor(name)  # Single descriptor

Sanitization Operations

Operation Description
complete Full sanitization (default)
unsalt Remove salts/counter-ions
aromatize Perceive aromaticity
kekulize Convert to Kekule form
neutralize Neutralize charges
normalize Normalize functional groups
remove_stereo Remove stereochemistry
remove_isotopes Remove isotope labels
remove_h Remove explicit hydrogens

Performance

Benchmarks on MacBook Air M3 (8-core, 16GB RAM):

Library Throughput vs RDKit
pycchem 28,311/s 2.52x
RDKit 11,229/s 1.00x

Requirements

  • Python 3.9+
  • cffi >= 1.15.0

License

Apache License 2.0

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pycchem-1.1.0.tar.gz (668.8 kB view details)

Uploaded Source

Built Distributions

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

pycchem-1.1.0-cp312-cp312-win_amd64.whl (1.3 MB view details)

Uploaded CPython 3.12Windows x86-64

pycchem-1.1.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.7 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.17+ x86-64

pycchem-1.1.0-cp312-cp312-macosx_11_0_arm64.whl (665.6 kB view details)

Uploaded CPython 3.12macOS 11.0+ ARM64

pycchem-1.1.0-cp312-cp312-macosx_10_9_x86_64.whl (725.1 kB view details)

Uploaded CPython 3.12macOS 10.9+ x86-64

pycchem-1.1.0-cp311-cp311-win_amd64.whl (1.3 MB view details)

Uploaded CPython 3.11Windows x86-64

pycchem-1.1.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.7 MB view details)

Uploaded CPython 3.11manylinux: glibc 2.17+ x86-64

pycchem-1.1.0-cp311-cp311-macosx_11_0_arm64.whl (665.6 kB view details)

Uploaded CPython 3.11macOS 11.0+ ARM64

pycchem-1.1.0-cp311-cp311-macosx_10_9_x86_64.whl (725.0 kB view details)

Uploaded CPython 3.11macOS 10.9+ x86-64

pycchem-1.1.0-cp310-cp310-win_amd64.whl (1.3 MB view details)

Uploaded CPython 3.10Windows x86-64

pycchem-1.1.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.7 MB view details)

Uploaded CPython 3.10manylinux: glibc 2.17+ x86-64

pycchem-1.1.0-cp310-cp310-macosx_11_0_arm64.whl (665.6 kB view details)

Uploaded CPython 3.10macOS 11.0+ ARM64

pycchem-1.1.0-cp310-cp310-macosx_10_9_x86_64.whl (725.0 kB view details)

Uploaded CPython 3.10macOS 10.9+ x86-64

pycchem-1.1.0-cp39-cp39-win_amd64.whl (1.3 MB view details)

Uploaded CPython 3.9Windows x86-64

pycchem-1.1.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.7 MB view details)

Uploaded CPython 3.9manylinux: glibc 2.17+ x86-64

pycchem-1.1.0-cp39-cp39-macosx_11_0_arm64.whl (665.6 kB view details)

Uploaded CPython 3.9macOS 11.0+ ARM64

pycchem-1.1.0-cp39-cp39-macosx_10_9_x86_64.whl (725.0 kB view details)

Uploaded CPython 3.9macOS 10.9+ x86-64

File details

Details for the file pycchem-1.1.0.tar.gz.

File metadata

  • Download URL: pycchem-1.1.0.tar.gz
  • Upload date:
  • Size: 668.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for pycchem-1.1.0.tar.gz
Algorithm Hash digest
SHA256 f684ff876df7c37c7e065d6bf166c3e0df6e0835f627ccc54846f1dc924a3950
MD5 298985cf7b54a301e417a0b4b22cca5f
BLAKE2b-256 df91301df35fb266e8f34c2acdb238f7bed5dca469cdb110be535e9f0347018d

See more details on using hashes here.

Provenance

The following attestation bundles were made for pycchem-1.1.0.tar.gz:

Publisher: wheels.yml on Vitruves/cchem

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

File details

Details for the file pycchem-1.1.0-cp312-cp312-win_amd64.whl.

File metadata

  • Download URL: pycchem-1.1.0-cp312-cp312-win_amd64.whl
  • Upload date:
  • Size: 1.3 MB
  • Tags: CPython 3.12, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for pycchem-1.1.0-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 57f1eb04d04fbcdcaf8350ca29fcc510b247a54782426c583761d58cc85e8077
MD5 c24771b373057bd49378edd29fd08e68
BLAKE2b-256 9a47c1857e2e54baf782603634164adb9a99010a192d5c85adf256afa522d466

See more details on using hashes here.

Provenance

The following attestation bundles were made for pycchem-1.1.0-cp312-cp312-win_amd64.whl:

Publisher: wheels.yml on Vitruves/cchem

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

File details

Details for the file pycchem-1.1.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for pycchem-1.1.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 4b47f9fb89da7fc5be3d94ff2e5d3e74c72aa7c1636e2677791d293da7ed1503
MD5 0445b0aa2a412bd3312ed4c170a05c1c
BLAKE2b-256 e513de057f383d7e990ae12f85305363c99cde54ae3469d3256c0bcae4a589b4

See more details on using hashes here.

Provenance

The following attestation bundles were made for pycchem-1.1.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl:

Publisher: wheels.yml on Vitruves/cchem

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

File details

Details for the file pycchem-1.1.0-cp312-cp312-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for pycchem-1.1.0-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 32a9aeca146a60d225c32d2cacc21be6317684aae159431b5cb71f95ba8f7884
MD5 5a1f2894f148197f0cb4d187a4fce5e9
BLAKE2b-256 b5f1378c9b65a7d4f7ff9d96f2c4e2e2e3e249c703b520679397ba0f827a3e14

See more details on using hashes here.

Provenance

The following attestation bundles were made for pycchem-1.1.0-cp312-cp312-macosx_11_0_arm64.whl:

Publisher: wheels.yml on Vitruves/cchem

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

File details

Details for the file pycchem-1.1.0-cp312-cp312-macosx_10_9_x86_64.whl.

File metadata

File hashes

Hashes for pycchem-1.1.0-cp312-cp312-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 d9d8f2fde0984980545acd5f34ab6f59c0d684d9eaa2a92d69050d6233d2a9fd
MD5 448b8695129a0c70662ebb2c23e0429a
BLAKE2b-256 9af9d81fd2f691ea25fd4a4ded1a7b9db0b50f252ec4be58dd131ed6438a1395

See more details on using hashes here.

Provenance

The following attestation bundles were made for pycchem-1.1.0-cp312-cp312-macosx_10_9_x86_64.whl:

Publisher: wheels.yml on Vitruves/cchem

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

File details

Details for the file pycchem-1.1.0-cp311-cp311-win_amd64.whl.

File metadata

  • Download URL: pycchem-1.1.0-cp311-cp311-win_amd64.whl
  • Upload date:
  • Size: 1.3 MB
  • Tags: CPython 3.11, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for pycchem-1.1.0-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 b22be20f66f77a4234d9c609f63dcba91f41fd25e32a3910fdba5d331afa35a6
MD5 38221d8ea86e3b903d818c8dcd941f35
BLAKE2b-256 b04474449f1ab82ee3bb35501c99b7cb809f173670f71479ac3a1e9403ac213f

See more details on using hashes here.

Provenance

The following attestation bundles were made for pycchem-1.1.0-cp311-cp311-win_amd64.whl:

Publisher: wheels.yml on Vitruves/cchem

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

File details

Details for the file pycchem-1.1.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for pycchem-1.1.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 5034aefb35dcc0be32bd1d0345450a258e3b9b98a7a2e47c825ce1dd60386a5c
MD5 11f760f563c9e392e6f8e9dd286c4750
BLAKE2b-256 f8e4c888d27358c2fff69d0fa24aac21901de7ab95ce295cc45362c290fa3639

See more details on using hashes here.

Provenance

The following attestation bundles were made for pycchem-1.1.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl:

Publisher: wheels.yml on Vitruves/cchem

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

File details

Details for the file pycchem-1.1.0-cp311-cp311-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for pycchem-1.1.0-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 38d575a6aa0cc19db7e137fa44b7eaffa391d911bb3ea80210a6367e905645e1
MD5 4204b19da2837a769182dd80d119d6ec
BLAKE2b-256 6c2ed6db96f8e248aa6fb9cdc2bbb50f6d9dd1e7237fdee47f5938ddd30fa5b2

See more details on using hashes here.

Provenance

The following attestation bundles were made for pycchem-1.1.0-cp311-cp311-macosx_11_0_arm64.whl:

Publisher: wheels.yml on Vitruves/cchem

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

File details

Details for the file pycchem-1.1.0-cp311-cp311-macosx_10_9_x86_64.whl.

File metadata

File hashes

Hashes for pycchem-1.1.0-cp311-cp311-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 23e3af6fc4c6d8b8bca98a30dcef3d21277fb62d8cd96fdb8065c48db7a715a6
MD5 1881ef064ffdc77124e9ff1ddc92797b
BLAKE2b-256 4ffefb13efdf785a85971969cc263122b1618a4680749c47ae790f5330f92e23

See more details on using hashes here.

Provenance

The following attestation bundles were made for pycchem-1.1.0-cp311-cp311-macosx_10_9_x86_64.whl:

Publisher: wheels.yml on Vitruves/cchem

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

File details

Details for the file pycchem-1.1.0-cp310-cp310-win_amd64.whl.

File metadata

  • Download URL: pycchem-1.1.0-cp310-cp310-win_amd64.whl
  • Upload date:
  • Size: 1.3 MB
  • Tags: CPython 3.10, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for pycchem-1.1.0-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 fdef092c87f21601d4a7d14aac169dfbea2e7bcd540a2cae1b58b0bcc5b1713b
MD5 9b612c0525becdca4a650be7d4db0dcb
BLAKE2b-256 eeb012da368f87d06a13df089dbfb5702cb0743d79b1b668cdd6e0b6ffb491ef

See more details on using hashes here.

Provenance

The following attestation bundles were made for pycchem-1.1.0-cp310-cp310-win_amd64.whl:

Publisher: wheels.yml on Vitruves/cchem

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

File details

Details for the file pycchem-1.1.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for pycchem-1.1.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 043b4d6a72d16eda4b5a024dd7ce7c7cdcd2bce465c0c1119fb7210f1cb37996
MD5 849709d14098fbc432d8dac287c214f8
BLAKE2b-256 76b2efb2c357e4ac041527f004402e870904f24561126161ef883fed55419238

See more details on using hashes here.

Provenance

The following attestation bundles were made for pycchem-1.1.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl:

Publisher: wheels.yml on Vitruves/cchem

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

File details

Details for the file pycchem-1.1.0-cp310-cp310-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for pycchem-1.1.0-cp310-cp310-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 a944eb5b648f5a6d5b6819f03661d2bc9eac9658c841641ff7d0b9b78348772e
MD5 bd2e0f03ef2106a254aad0fd23241c21
BLAKE2b-256 a486de7f337232612709c0ab00d7559e0b979cf10fdcdab1452ab7b34ac3e82c

See more details on using hashes here.

Provenance

The following attestation bundles were made for pycchem-1.1.0-cp310-cp310-macosx_11_0_arm64.whl:

Publisher: wheels.yml on Vitruves/cchem

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

File details

Details for the file pycchem-1.1.0-cp310-cp310-macosx_10_9_x86_64.whl.

File metadata

File hashes

Hashes for pycchem-1.1.0-cp310-cp310-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 f5c18ed7f90669b32674864ec4e2bbecd7730ed74f2411d8861bae25b62a6fa5
MD5 2d16bfa1762335a6a4aa9a5b1dd0ce92
BLAKE2b-256 24b678137ecfad0979124585962aae7f49dfa66bf209c4ec1ac9e75fc7f056e0

See more details on using hashes here.

Provenance

The following attestation bundles were made for pycchem-1.1.0-cp310-cp310-macosx_10_9_x86_64.whl:

Publisher: wheels.yml on Vitruves/cchem

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

File details

Details for the file pycchem-1.1.0-cp39-cp39-win_amd64.whl.

File metadata

  • Download URL: pycchem-1.1.0-cp39-cp39-win_amd64.whl
  • Upload date:
  • Size: 1.3 MB
  • Tags: CPython 3.9, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for pycchem-1.1.0-cp39-cp39-win_amd64.whl
Algorithm Hash digest
SHA256 678123428bf45644edaddc6e41acdf53779f9c17db6dfa7b3fe4a29f84a4f59f
MD5 19c5c7d73be177b2af21e66df60ae587
BLAKE2b-256 b39db785d5956a0a41431cf0adc907bdfcef13a7002b4cd802ddb868695bbfdb

See more details on using hashes here.

Provenance

The following attestation bundles were made for pycchem-1.1.0-cp39-cp39-win_amd64.whl:

Publisher: wheels.yml on Vitruves/cchem

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

File details

Details for the file pycchem-1.1.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for pycchem-1.1.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 cc05ec3d0438dff91bd046717eb0e7d68ae86402e5e1b265184799fb7d0f65b8
MD5 bd7d56f9f21254b2c2172aa075842b37
BLAKE2b-256 d9403edde914b8043555549d03dbb842d36f702ef21173657c00afc5492f5988

See more details on using hashes here.

Provenance

The following attestation bundles were made for pycchem-1.1.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl:

Publisher: wheels.yml on Vitruves/cchem

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

File details

Details for the file pycchem-1.1.0-cp39-cp39-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for pycchem-1.1.0-cp39-cp39-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 edc94ba52423a86b1eb114c1043a113f09a11d90e3697e2429076a2b82b0680c
MD5 d5cfdbe599df9ca7b53640fd2279a95b
BLAKE2b-256 8d5ebe5d6c7f2d2ebc8a162727c42be8f843ac507f960f64cbc4ebc769c92786

See more details on using hashes here.

Provenance

The following attestation bundles were made for pycchem-1.1.0-cp39-cp39-macosx_11_0_arm64.whl:

Publisher: wheels.yml on Vitruves/cchem

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

File details

Details for the file pycchem-1.1.0-cp39-cp39-macosx_10_9_x86_64.whl.

File metadata

File hashes

Hashes for pycchem-1.1.0-cp39-cp39-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 a3757bf09ea394c35c955ad981b4ab60d8b144d1fcda47debbe7062f5f56875d
MD5 dbbc3d89c8f46318e32285da2173171f
BLAKE2b-256 3a8c731fdd2bd7f94736fb32aafab3f2b5d8d35791e3b1625ff90a2584e9954a

See more details on using hashes here.

Provenance

The following attestation bundles were made for pycchem-1.1.0-cp39-cp39-macosx_10_9_x86_64.whl:

Publisher: wheels.yml on Vitruves/cchem

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

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page