Skip to main content

cholla_chem

PyPI version Maintenance License Run Tests Build Docs Open In Colab

This library is used for performant, comprehensive, and customizable name-to-SMILES conversions.

This library can use the following existing name-to-SMILES resolvers:

This library also implements the following new resolvers:

  • Manually curated dataset of common names not correctly resolved by other resolvers (e.g. 'NaH')
  • Structural formula resolver (e.g. 'CH3CH2CH2COOH')
  • Inorganic shorthand resolver (e.g. '[Cp*RhCl2]2')

The following string editing/manipulation strategies may be applied to compounds to assist with name-to-SMILES resolution:

  • String sanitization for special characters and mojibake encoding errors
  • Name correction for OCR errors, typos, pagination errors, etc.
  • Splitting compounds on common delimiters (useful for mixtures of compounds, e.g. 'BH3•THF')
  • Peptide shorthand expansion (e.g. 'cyclo(Asp-Arg-Val-Tyr-Ile-His-Pro-Phe)' -> 'cyclo(l-aspartyl-l-arginyl-l-valyl-l-tyrosyl-l-isoleucyl-l-histidyl-l-prolyl-l-phenylalanyl)')

When resolvers disagree on the SMILES for a given compound, a variety of SMILES selection methods can be employed to determine the "best" SMILES for a given compound name. See the documentation for more details.

Installation

Install cholla_chem with pip:

pip install cholla_chem

Alternatively, pip install directly from the repo:

pip install git+https://github.com/denovochem/cholla_chem.git

Basic usage

Resolve chemical names to SMILES by passing a string or a list of strings:

from cholla_chem import resolve_compounds_to_smiles

resolved_smiles = resolve_compounds_to_smiles(compounds_list=['aspirin'])

"{'aspirin': 'CC(=O)Oc1ccccc1C(=O)O'}"

See detailed information including which resolver returned which SMILES with detailed_name_dict=True:

from cholla_chem import resolve_compounds_to_smiles

resolved_smiles = resolve_compounds_to_smiles(
    compounds_list=['2-acetyloxybenzoic acid'], 
    detailed_name_dict=True
)

"{'2-acetyloxybenzoic acid': {
    'SMILES': 'CC(=O)Oc1ccccc1C(=O)O',
    'SMILES_source': ['pubchem_default', 'opsin_default'],
    'SMILES_dict': {
        'CC(=O)Oc1ccccc1C(=O)O': ['pubchem_default', 'opsin_default']
    },
    'additional_info': {}
}}"

Advanced usage

Many aspects of the name-to-SMILES resolution process can be customized, including the resolvers that are used, the configuration of those resolvers, and the strategy used to pick the best SMILES.

In this example, we resolve chemical names with OPSIN, PubChem, and CIRPy, and use a custom consensus weighting approach to pick the best SMILES:

from cholla_chem import (
    OpsinNameResolver,
    PubChemNameResolver,
    CIRpyNameResolver,
    resolve_compounds_to_smiles,
)

opsin_resolver = OpsinNameResolver(
    resolver_name='opsin', 
    resolver_weight=4
)
pubchem_resolver =  PubChemNameResolver(
    resolver_name='pubchem', 
    resolver_weight=3
)
cirpy_resolver = CIRpyNameResolver(
    resolver_name='cirpy', 
    resolver_weight=2
)

resolved_smiles = resolve_compounds_to_smiles(
    compounds_list=['2-acetyloxybenzoic acid'],
    resolvers_list=[opsin_resolver, pubchem_resolver, cirpy_resolver],
    smiles_selection_mode='weighted',
    detailed_name_dict=True
)

"{'2-acetyloxybenzoic acid': {
    'SMILES': 'CC(=O)Oc1ccccc1C(=O)O',
    'SMILES_source': ['opsin', 'pubchem', 'cirpy'],
    'SMILES_dict': {
        'CC(=O)Oc1ccccc1C(=O)O': ['opsin', 'pubchem', 'cirpy']
    },
    'additional_info': {}
}}"

Command line interface

cholla_chem can be used as a command line tool. The command line interface can resolve single chemical names directly from the command line or read from a file.

Resolve compounds directly from the command line:

cholla-chem "aspirin"

Resolve compounds from a file:

cholla-chem --input names.txt --output results.tsv

See help for more options:

cholla-chem --help

See documentation for more details.

Documentation

Full documentation is available here

Contributing

  • Feature ideas and bug reports are welcome on the Issue Tracker.
  • Fork the source code on GitHub, make changes and file a pull request.

License

cholla_chem is licensed under the MIT license.

Release files for cholla-chem 0.2.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for cholla-chem 0.2.1
File Size Uploaded
cholla_chem-0.2.1.tar.gz 13.5 MB Details

Built distribution (wheel)

Table of built distributions (wheels) for cholla-chem 0.2.1
File Interpreter ABI Platform
cholla_chem-0.2.1-py3-none-any.whl Python 3 none any Details

Total release size: 27.0 MB

Release files / cholla_chem-0.2.1.tar.gz

Download URL cholla_chem-0.2.1.tar.gz
Size 13.5 MB
Tags Source
SHA-256 checksum
How to use checksums
0e8a2529044ec367eefc4f7197a834363415ad9efedb790067571a09e851f9d5
BLAKE2b-256 checksum
How to use checksums
1a2d263ce3a9336241fe4f2a1a3ae0b9db71823905678f7c94dc8ef7eb9e286d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jun 13, 2026.

Transparency log

Release files / cholla_chem-0.2.1-py3-none-any.whl

Download URL cholla_chem-0.2.1-py3-none-any.whl
Size 13.5 MB
Tags Python 3
SHA-256 checksum
How to use checksums
a88d232433bb99d5dee8e3fd2504eba2f70599ea079e3839ccdcc1e98e90975a
BLAKE2b-256 checksum
How to use checksums
9616be23f40043cd5ecd90f2181f861a64a5f26f8b3319f2bdef67ad76381681
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jun 13, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

0.2.1 This release

2 release files

0.2.0

2 release 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