A package to use several web services to find molecule structures, synonyms and CAS.
Project description
MoleculeResolver
A python class allowing to use several web services to find molecule structures/names/CAS based on their identifiers such as name, CAS, SMILES, InChI, etc.
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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distributions
Hashes for molecule_resolver-0.1.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1f7abab63c54b492bd690d71f833f7833a23357c409cdbf33c61435f51606fbf |
|
MD5 | 97f02b35d3d83f4f450082211f306b3b |
|
BLAKE2b-256 | 2beefa075da07c7f442a54ce54ef8c85073f67a516a5a77eb79a9f7cc0cdb632 |
Hashes for molecule_resolver-0.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 058ec50ee95cd5a04cbd78f114eabd5c8e2477ce9bbf52fee212e22e8cab3567 |
|
MD5 | 4274a11e627315d0806e5c6acdd88404 |
|
BLAKE2b-256 | cf78c9f74e6e41a49af85f7e096b4732d0eec5986e36f56c36599ed746041af0 |