Package: chemprice
ChemPriceChemPrice 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.ResourcesUser ManualYou can find the detailed features and examples in the following link:User Manual.Web ApplicationChemPrice is also available as a web application. You can use it at the following link:Web Application.InstallationUse pipChemPrice can be installed using pip by
running:pip install chempriceHow to use ChempriceGetting startedChemPrice requires a list of molecule SMILES as the representation of molecules: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.fromchemipriceimportPriceCollectorpc=PriceCollector()Request an API keyTo 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,ChemSpaceandMCule,
which will take you back to their sites where you can request an API key.Set the API key for each integratorNow, an instance from thePriceCollectorclass has been created, we need to connect to one
or more integrators via an API key.Connection to Molport via API key:pc.setMolportApiKey("880d8343-8ui2-418c-9g7a-68b4e2e78c8b")In the case of Molport, it's also possible to log in with a login and password.pc.setMolportUsername("john.spade")pc.setMolportPassword("fasdga34a3")To check the status of each key, run the following method :pc.status()Possible Outputs# Username/Password and API Key are Set:Status:Molport:bothcredentialsareset.# Only Username/Password or API Key is Set:Status:Molport:credentialisset.# No Credential is Set:Status:Molport:nocredentialisset.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 :pc.setChemSpaceApiKey(<chemspace_api_key>)pc.setMCuleApiKey(<mcule_api_key>)Price SearchBefore starting the price search, check the validity of the API keys entered.pc.check()Possible Outputs:# API Key is Set and correct:Check:MolportAPIkeyiscorrect.# API Key is Set but not correct:Check:MolportAPIkeyisincorrect.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.all_prices=pc.collect()The output will be a dataframe containing all price information about the molecule.Input SmilesSourceSupplier NamePurityAmountMeasurePrice_USDCC(=O)NC1=CC=C(C=C1)OMolport"ChemDiv, Inc.">90100mg407.1CC(=O)NC1=CC=C(C=C1)OMolportMedChemExpress Europe98.8310g112.8CC(=O)NC1=CC=C(C=C1)OMolportTargetMol Chemicals100.0500mg50.0With 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.pc.selectBest(all_prices)The output will be a dataframe containing only the best quantity/price ratio of each molecule.Input SmilesSourceSupplier NamePurityAmountMeasurePrice_USDUSD/gUSD/molCC(=O)NC1=CC=C(C=C1)OMolportCayman Europe>=98500g407.10.22O=C(C)Oc1ccccc1C(=O)OMolportCayman Europe>=90500g112.80.1606O=C(C)Oc1ccccc1C(=O)OMolportLife Chemicals Inc.>9020micromol50.03950000.0000000005ContactFor any question you can contact us through email:Baptiste Saliou