Metadata-Version: 2.1
Name: molecule-resolver
Version: 0.1.1
Summary: A package to use several web services to find molecule structures, synonyms and CAS.
License: MIT
Author: Simon Muller
Author-email: simon.mueller@tuhh.de
Requires-Python: >=3.9,<3.12
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Requires-Dist: openpyxl (>=3.1.2,<4.0.0)
Requires-Dist: prompt-toolkit (>=3.0.39,<4.0.0)
Requires-Dist: rdkit (>=2023.3.3,<2024.0.0)
Requires-Dist: regex (>=2023.10.3,<2024.0.0)
Requires-Dist: requests (>=2.31.0,<3.0.0)
Requires-Dist: tqdm (>=4.66.1,<5.0.0)
Requires-Dist: urllib3 (>=2.0.6,<3.0.0)
Requires-Dist: xmltodict (>=0.13.0,<0.14.0)
Description-Content-Type: text/markdown

# 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](https://pypi.org/project/molecule-resolver/).

```
pip intall molecule-resolver
```

## Usage

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

```python
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:

```python
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.

```python
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
```
