API documentation

ChemPrice principal class is PriceCollector.

chemprice.PriceCollector

class chemprice.PriceCollector[source]

A class for collecting and checking API credentials, as well as data collection and filtering.

setMolportUsername(username)[source]

Sets the Molport username.

Parameters

username – The Molport username to set.

setMolportPassword(password)[source]

Sets the Molport password.

Parameters

password – The Molport password to set.

setMolportApiKey(api_key)[source]

Sets the Molport api key.

Parameters

api_key – The Molport api key to set.

setChemSpaceApiKey(api_key)[source]

Sets the ChemSpace api key.

Parameters

api_key – The ChemSpace api key to set.

setMCuleApiKey(api_key)[source]

Sets the MCule api key.

Parameters

api_key – The MCule api key to set.

status()[source]

Displays the set status of various API keys.

check(Molport=True, ChemSpace=True, MCule=True)[source]

Checks the validity of API credentials.

Parameters
  • Molport – Whether to check Molport credentials.

  • ChemSpace – Whether to check ChemSpace credentials.

  • MCule – Whether to check MCule credentials.

Returns

A value indicating whether the checks were successful.

collect(smiles_list, progress_output=None)[source]

Collects data using API credentials.

Parameters
  • smiles_list – List of SMILES representations.

  • progress_output – Progress output (optional).

Returns

A DataFrame containing collected data.

selectBest(dataframe)[source]

Filters and selects the best data from a DataFrame.

Parameters

dataframe – The input DataFrame.

Returns

The filtered DataFrame.

Utils

utils.molport_collect_prices(instance, molecule_ids)[source]

Collects price data for molecules from Molport API.

Parameters
  • instance (PriceCollector) – The PriceCollector instance containing API credentials.

  • molecule_ids (pandas.DataFrame) – DataFrame containing molecule IDs and SMILES.

Returns

DataFrame containing collected price data.

Return type

pandas.DataFrame

utils.chemspace_collect_prices(instance, smiles_list)[source]

Collects price data for molecules from ChemSpace API.

Parameters
  • instance (PriceCollector) – The PriceCollector instance containing API credentials.

  • smiles_list (list) – list containing molecule SMILES.

Returns

DataFrame containing collected price data.

Return type

pandas.DataFrame

utils.mcule_collect_prices(instance, package_ids)[source]

Collects price data for molecules from MCule API.

Parameters
  • instance (PriceCollector) – The PriceCollector instance containing API credentials.

  • package_ids (list) – list containing molecule package IDs.

Returns

DataFrame containing collected price data.

Return type

pandas.DataFrame