<p align="center">
<img width="600" src="https://i.imgur.com/UHf6OV0.png">
</p>
<br />
# ChemPrice
ChemPrice is a software tool designed for the purpose of gathering pricing information for specific molecules. It is capable of retrieving price data from three different integration sources: Molport, ChemSpace, and MCule. To access these integrators, users must provide an API key for each one.
## Resources
### User Manual
You can find the detailed features and examples in the following link: [User Manual](https://).
### Web Application
ChemPrice is also available as a web application. You can use it at the following link: [Web Application](https://).
## Installation
### Use pip
ChemPrice can be installed using pip by
running:
pip install chemprice
## How to use Chemprice
### Getting started
ChemPrice requires a list of molecule SMILES as the representation of molecules:
```python
smiles_list = ["CC(=O)NC1=CC=C(C=C1)O", "CC(C)CC1=CC=C(C=C1)C(C)C(=O)O", "O=C(C)Oc1ccccc1C(=O)O"]
```
First, we need to create an instance from the PriceCollector class. Using this instance, we'll be able to connect to the various integrators and then launch a search
on the list of smiles entered.
```python
from chemiprice import PriceCollector
pc = PriceCollector()
```
### Request an API key
To access integrators' data, you need to be able to connect to their API.
If you don't have an API key yet, you can click on the following links :
[Molport](https://www.molport.com/shop/user-api-keys),
[ChemSpace](https://chem-space.com/contacts) and
[MCule](https://mcule.com/contact/),
which will take you back to their sites where you can request an API key.
### Set the API key for each integrator
Now, an instance from the `PriceCollector` class has been created, we need to connect to one
or more integrators via an API key.
Connection to Molport via API key:
```python
pc.setMolportApiKey("880d8343-8ui2-418c-9g7a-68b4e2e78c8b")
```
In the case of Molport, it's also possible to log in with a login and password.
```python
pc.setMolportUsername("john.spade")
pc.setMolportPassword("fasdga34a3")
```
To check the status of each key, run the following method :
```python
pc.status()
```
Possible Outputs
```python
# Username/Password and API Key are Set:
Status: Molport: both credentials are set.
# Only Username/Password or API Key is Set:
Status: Molport: credential is set.
# No Credential is Set:
Status: Molport: no credential is set.
```
Similar to the Molport connection, for ChemSpace and MCule, the approach is the same. However, ChemSpace and MCule require only an API key. You need to use
the :mod:`setChemSpaceApiKey()` and :mod:`setMCuleApiKey()` functions, such as :
```python
pc.setChemSpaceApiKey(<chemspace_api_key>)
pc.setMCuleApiKey(<mcule_api_key>)
```
### Price Search
Before starting the price search, check the validity of the API keys entered.
```python
pc.check()
```
Possible Outputs:
```python
# API Key is Set and correct:
Check: Molport API key is correct.
# API Key is Set but not correct:
Check: Molport API key is incorrect.
```
If the identifiers checked are correct, then it's possible
to run the method :mod:`collect()` to obtain all the information
found on the molecule. The price is given in USD according to
the units and quantity entered by the vendor. The units of measurement
for quantities are categorized into three families: mols, grams, and liters.
```python
all_prices = pc.collect()
```
The output will be a dataframe containing all price information about the molecule.
| Input Smiles | Source | Supplier Name | Purity | Amount | Measure | Price_USD |
| --------------------- | ------- | --------------------- | ------ | ------ | ------- | --------- |
| CC(=O)NC1=CC=C(C=C1)O | Molport | "ChemDiv, Inc." | >90 | 100 | mg | 407.1 |
| CC(=O)NC1=CC=C(C=C1)O | Molport | MedChemExpress Europe | 98.83 | 10 | g | 112.8 |
| CC(=O)NC1=CC=C(C=C1)O | Molport | TargetMol Chemicals | 100.0 | 500 | mg | 50.0 |
With the :mod:`selectBest()` function, you can keep only the best prices for each molecule.
In fact, for each unit of measurement (mol gram and liter) the results are compared
to find the best quantity/price ratio.
```python
pc.selectBest(all_prices)
```
The output will be a dataframe containing only the best quantity/price ratio of each molecule.
| Input Smiles | Source | Supplier Name | Purity | Amount | Measure | Price_USD | USD/g | USD/mol |
| --------------------- | ------- | ------------------- | ------ | ------ | -------- | --------- | ------ | ------------------ |
| CC(=O)NC1=CC=C(C=C1)O | Molport | Cayman Europe | >=98 | 500 | g | 407.1 | 0.22 | |
| O=C(C)Oc1ccccc1C(=O)O | Molport | Cayman Europe | >=90 | 500 | g | 112.8 | 0.1606 | |
| O=C(C)Oc1ccccc1C(=O)O | Molport | Life Chemicals Inc. | >90 | 20 | micromol | 50.0 | | 3950000.0000000005 |
### Contact
For any question you can contact us through email:
- [Baptiste Saliou](mailto:baptiste1saliou@gmail.com)
Raw data
{
"_id": null,
"home_page": "https://github.com/bsaliou/ChemPrice",
"name": "chemprice",
"maintainer": "",
"docs_url": null,
"requires_python": ">=3.6",
"maintainer_email": "",
"keywords": "chemoinformatics",
"author": "Baptiste SALIOU",
"author_email": "baptiste1saliou@gmail.com",
"download_url": "https://files.pythonhosted.org/packages/7f/d3/2fd4e9c6a532abb026726086c957c0bd09e1ce5c9ac4cfefc215434d7359/chemprice-1.1.0.tar.gz",
"platform": null,
"description": "<p align=\"center\">\n <img width=\"600\" src=\"https://i.imgur.com/UHf6OV0.png\">\n</p>\n<br />\n\n# ChemPrice\n\nChemPrice is a software tool designed for the purpose of gathering pricing information for specific molecules. It is capable of retrieving price data from three different integration sources: Molport, ChemSpace, and MCule. To access these integrators, users must provide an API key for each one.\n\n## Resources\n\n### User Manual\n\nYou can find the detailed features and examples in the following link: [User Manual](https://).\n\n### Web Application\n\nChemPrice is also available as a web application. You can use it at the following link: [Web Application](https://).\n\n## Installation\n\n### Use pip\n\nChemPrice can be installed using pip by\nrunning:\n\n pip install chemprice\n\n## How to use Chemprice\n\n### Getting started\n\nChemPrice requires a list of molecule SMILES as the representation of molecules:\n\n```python\nsmiles_list = [\"CC(=O)NC1=CC=C(C=C1)O\", \"CC(C)CC1=CC=C(C=C1)C(C)C(=O)O\", \"O=C(C)Oc1ccccc1C(=O)O\"]\n```\n\nFirst, we need to create an instance from the PriceCollector class. Using this instance, we'll be able to connect to the various integrators and then launch a search\non the list of smiles entered.\n\n```python\nfrom chemiprice import PriceCollector\npc = PriceCollector()\n```\n\n### Request an API key\n\nTo access integrators' data, you need to be able to connect to their API.\n\nIf you don't have an API key yet, you can click on the following links :\n[Molport](https://www.molport.com/shop/user-api-keys),\n[ChemSpace](https://chem-space.com/contacts) and\n[MCule](https://mcule.com/contact/),\nwhich will take you back to their sites where you can request an API key.\n\n### Set the API key for each integrator\n\nNow, an instance from the `PriceCollector` class has been created, we need to connect to one\nor more integrators via an API key.\n\nConnection to Molport via API key:\n\n```python\npc.setMolportApiKey(\"880d8343-8ui2-418c-9g7a-68b4e2e78c8b\")\n```\n\nIn the case of Molport, it's also possible to log in with a login and password.\n\n```python\npc.setMolportUsername(\"john.spade\")\npc.setMolportPassword(\"fasdga34a3\")\n```\n\nTo check the status of each key, run the following method :\n\n```python\npc.status()\n```\n\nPossible Outputs\n\n```python\n# Username/Password and API Key are Set:\nStatus: Molport: both credentials are set.\n\n# Only Username/Password or API Key is Set:\nStatus: Molport: credential is set.\n\n# No Credential is Set:\nStatus: Molport: no credential is set.\n```\n\nSimilar to the Molport connection, for ChemSpace and MCule, the approach is the same. However, ChemSpace and MCule require only an API key. You need to use\nthe :mod:`setChemSpaceApiKey()` and :mod:`setMCuleApiKey()` functions, such as :\n\n```python\npc.setChemSpaceApiKey(<chemspace_api_key>)\npc.setMCuleApiKey(<mcule_api_key>)\n```\n\n### Price Search\n\nBefore starting the price search, check the validity of the API keys entered.\n\n```python\npc.check()\n```\n\nPossible Outputs:\n\n```python\n# API Key is Set and correct:\nCheck: Molport API key is correct.\n\n# API Key is Set but not correct:\nCheck: Molport API key is incorrect.\n```\n\nIf the identifiers checked are correct, then it's possible\nto run the method :mod:`collect()` to obtain all the information\nfound on the molecule. The price is given in USD according to\nthe units and quantity entered by the vendor. The units of measurement\nfor quantities are categorized into three families: mols, grams, and liters.\n\n```python\nall_prices = pc.collect()\n```\n\nThe output will be a dataframe containing all price information about the molecule.\n\n| Input Smiles | Source | Supplier Name | Purity | Amount | Measure | Price_USD |\n| --------------------- | ------- | --------------------- | ------ | ------ | ------- | --------- |\n| CC(=O)NC1=CC=C(C=C1)O | Molport | \"ChemDiv, Inc.\" | >90 | 100 | mg | 407.1 |\n| CC(=O)NC1=CC=C(C=C1)O | Molport | MedChemExpress Europe | 98.83 | 10 | g | 112.8 |\n| CC(=O)NC1=CC=C(C=C1)O | Molport | TargetMol Chemicals | 100.0 | 500 | mg | 50.0 |\n\nWith the :mod:`selectBest()` function, you can keep only the best prices for each molecule.\nIn fact, for each unit of measurement (mol gram and liter) the results are compared\nto find the best quantity/price ratio.\n\n```python\npc.selectBest(all_prices)\n```\n\nThe output will be a dataframe containing only the best quantity/price ratio of each molecule.\n\n| Input Smiles | Source | Supplier Name | Purity | Amount | Measure | Price_USD | USD/g | USD/mol |\n| --------------------- | ------- | ------------------- | ------ | ------ | -------- | --------- | ------ | ------------------ |\n| CC(=O)NC1=CC=C(C=C1)O | Molport | Cayman Europe | >=98 | 500 | g | 407.1 | 0.22 | |\n| O=C(C)Oc1ccccc1C(=O)O | Molport | Cayman Europe | >=90 | 500 | g | 112.8 | 0.1606 | |\n| O=C(C)Oc1ccccc1C(=O)O | Molport | Life Chemicals Inc. | >90 | 20 | micromol | 50.0 | | 3950000.0000000005 |\n\n### Contact\n\nFor any question you can contact us through email:\n\n- [Baptiste Saliou](mailto:baptiste1saliou@gmail.com)\n",
"bugtrack_url": null,
"license": "BSD",
"summary": "A python library for chemical price Search.",
"version": "1.1.0",
"project_urls": {
"Documentation": "https://chemprice.readthedocs.io/en/latest/",
"Homepage": "https://github.com/bsaliou/ChemPrice",
"Interface": "https://chemprice.streamlit.app/"
},
"split_keywords": [
"chemoinformatics"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "497e4b9ccfe5c35e6a0f9ee79616b617b091e8b93b2936a6b1144a0c6ed5ff66",
"md5": "b235bc9f6a4f69a94414be26c386a438",
"sha256": "79b5f187e8f2f3e7bffdff8161770deb643f84017e2e15d8cb0c58f962643151"
},
"downloads": -1,
"filename": "chemprice-1.1.0-py3-none-any.whl",
"has_sig": false,
"md5_digest": "b235bc9f6a4f69a94414be26c386a438",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.6",
"size": 78434,
"upload_time": "2024-01-10T01:37:37",
"upload_time_iso_8601": "2024-01-10T01:37:37.913177Z",
"url": "https://files.pythonhosted.org/packages/49/7e/4b9ccfe5c35e6a0f9ee79616b617b091e8b93b2936a6b1144a0c6ed5ff66/chemprice-1.1.0-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "7fd32fd4e9c6a532abb026726086c957c0bd09e1ce5c9ac4cfefc215434d7359",
"md5": "f4d224a559ebebe9eb2eeacd51fe6f0e",
"sha256": "054312d8d29439d4641d4a9310c7940e6e88a75d9e6030dc0a9cc138bcd0009d"
},
"downloads": -1,
"filename": "chemprice-1.1.0.tar.gz",
"has_sig": false,
"md5_digest": "f4d224a559ebebe9eb2eeacd51fe6f0e",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.6",
"size": 74101,
"upload_time": "2024-01-10T01:37:39",
"upload_time_iso_8601": "2024-01-10T01:37:39.846198Z",
"url": "https://files.pythonhosted.org/packages/7f/d3/2fd4e9c6a532abb026726086c957c0bd09e1ce5c9ac4cfefc215434d7359/chemprice-1.1.0.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-01-10 01:37:39",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "bsaliou",
"github_project": "ChemPrice",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"requirements": [],
"lcname": "chemprice"
}