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
Built Distribution
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
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3dd71041a8d07669a2bc2ef682a451543937627c46eb3bf4b42a8036d131d4b4 |
|
MD5 | 5d5ff5e796aa810e332547fdccf09ec0 |
|
BLAKE2b-256 | ebb1f5603db9658e65f5bfaf0d50b6da694ed19f2739627e5355449ea419ad56 |
File details
Details for the file molecule_resolver-0.2.1-py3-none-any.whl
.
File metadata
- Download URL: molecule_resolver-0.2.1-py3-none-any.whl
- Upload date:
- Size: 76.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.1.1 CPython/3.12.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 93ec180b1d791d0dea382fe7c4141389e6d06517901e84ce6a95193d9fcfaed9 |
|
MD5 | aa8693c42c72ceb5fc9c5a19445ada32 |
|
BLAKE2b-256 | 625a50fb260ea59f73e732f1f8e687233e8298903786a0d6cf719d6229b28026 |