Skip to main content

A package to use several web services to find molecule structures, synonyms and CAS.

Project description

MoleculeResolver

A python package allowing to use several web services to find molecule structures/names/CAS based on their identifiers such as name, CAS, SMILES, InChI, etc.

Installation

The package is available on pypi.

pip install molecule-resolver

Usage

Other examples available in apply.py, it is supposed to be called as context manager:

with MoleculeResolver(available_service_API_keys={'chemeo': 'YOUR_API_KEY'}) as cf:
    molecule = cf.find_single_molecule_cross_checked(['ethanol'], ['name'], minimum_number_of_cross_checks=1)

If you call it with as a context manager it will automatically silence all output from rdkit, as this can be substantial when parsing the data from the different web services.

If you want to have more control over what is muted from the rdkit output, you can also use the MoleculeResolver class like so:

from moleculeresolver.rdkitmods import disabling_rdkit_logger

with disabling_rdkit_logger(mute_errors = True, mute_warning = True, mute_info = True, mute_debug = True):
    cf = MoleculeResolver(available_service_API_keys={'chemeo': 'YOUR_API_KEY'})
    molecule = cf.find_single_molecule_cross_checked(['ethanol'], ['name'], minimum_number_of_cross_checks=1)

Under moleculeresolver.rdkitmods you will find the disabling_rdkit_logger class which can be used as a context manager or as a decorator that you can use if you want to mute input on one function alone.

from moleculeresolver.rdkitmods import disabling_rdkit_logger

@disabling_rdkit_logger(mute_errors = True, mute_warning = True, mute_info = True, mute_debug = True)
def yourfunction():
    pass

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

molecule_resolver-0.2.1.tar.gz (74.5 kB view details)

Uploaded Source

Built Distribution

molecule_resolver-0.2.1-py3-none-any.whl (76.8 kB view details)

Uploaded Python 3

File details

Details for the file molecule_resolver-0.2.1.tar.gz.

File metadata

  • Download URL: molecule_resolver-0.2.1.tar.gz
  • Upload date:
  • Size: 74.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/5.1.1 CPython/3.12.7

File hashes

Hashes for molecule_resolver-0.2.1.tar.gz
Algorithm Hash digest
SHA256 3dd71041a8d07669a2bc2ef682a451543937627c46eb3bf4b42a8036d131d4b4
MD5 5d5ff5e796aa810e332547fdccf09ec0
BLAKE2b-256 ebb1f5603db9658e65f5bfaf0d50b6da694ed19f2739627e5355449ea419ad56

See more details on using hashes here.

File details

Details for the file molecule_resolver-0.2.1-py3-none-any.whl.

File metadata

File hashes

Hashes for molecule_resolver-0.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 93ec180b1d791d0dea382fe7c4141389e6d06517901e84ce6a95193d9fcfaed9
MD5 aa8693c42c72ceb5fc9c5a19445ada32
BLAKE2b-256 625a50fb260ea59f73e732f1f8e687233e8298903786a0d6cf719d6229b28026

See more details on using hashes here.

Supported by

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