Quoting

Attention

It is now generally recommended to obtain a snapshot of the entire Enamine catalogue using one of the following links and not relying on the Pycule implementation in this module:

  • Global catalogue delivery from Kyiv, Ukraine, in 7-10 business days

  • EU stock delivery from Riga, Latvia, in 1-2 business days

class hippo.pycule.Quoter(supplier: str, username: str = None, password: str = None, token: str = None)[source]

Class to scrape catalogue data

Currently ‘Enamine’ and ‘MCule’ are supported. Once initialised

self(compound)[source]

Get quotes for a compound

get_batch_quote(compounds, **kwargs)[source]

Get quotes for a compound set

Parameters:

compounds

get_enamine_batch_quote(compounds, currency='USD', catalogues=None, exact=False, forms=False, analogues=False, equivalents=False)[source]
Parameters:
  • compounds

  • currency – (Default value = “USD”)

  • catalogues – (Default value = None)

  • exact – (Default value = False)

  • forms – (Default value = False)

  • analogues – (Default value = False)

  • equivalents – (Default value = False)

get_enamine_quote(compound, currency='USD')[source]
Parameters:
  • compound

  • currency – (Default value = “USD”)

get_mcule_batch_quote(compounds)[source]
Parameters:

compounds

get_mcule_quote(compound, exact=False)[source]
Parameters:
  • compound

  • exact – (Default value = False)

get_quote(compound, **kwargs)[source]

Get quotes for a compound

Parameters:

compound

parse_enamine_bulk_products(db, products)[source]
Parameters:
  • db

  • products

parse_enamine_delivery_string(string)[source]
Parameters:

string

parse_enamine_pack(compound, entry, purity, catalogue, pack, lead_time, smiles)[source]
Parameters:
  • compound

  • entry

  • purity

  • catalogue

  • pack

  • lead_time

  • smiles

parse_enamine_response(result, compound, catalogue)[source]
Parameters:
  • result

  • compound

  • catalogue

parse_mcule_pack(db, compound, entry, pack, smiles, commit=True)[source]
Parameters:
  • db

  • compound

  • entry

  • pack

  • smiles

  • commit – (Default value = True)

pick_enamine_data(comp_id, data)[source]
Parameters:
  • comp_id

  • data

pick_enamine_exact_data(smiles, data)[source]
Parameters:
  • smiles

  • data

class hippo.quote.Quote(db: Database, id: int, compound: int, smiles: str, supplier: str, catalogue: str, entry: str, amount: float, price: float, currency: str, purity: float, lead_time: int, date: str | None = None, type: str | None = None)[source]

Supplier quote for a specific quantity of a Compound.

Attention

Quote objects should not be created directly. Instead use Compound.get_quotes().

repr(self) str[source]

ANSI Formatted string representation

str(self)[source]

Unformatted string representation

property amount: float

Amount in mg

property catalogue: str | None

Name of the catalogue

classmethod combination(required_amount: float, quotes: list[Quote]) Quote[source]

Combine a list of quotes into one Quote object.

  • Start with biggest pack

  • Estimate by scaling linearly with unit price

Parameters:
  • required_amount – amount in mg

  • quotes – list of quotes to be combined

property compound: int

Returns the associated Compound

property currency: str

Currency of the associated Price object

property currency_symbol: str

Currency symbol of the associated Price

property date: str

Date the quote was registered to the database

property db: Database

Returns a pointer to the parent database

property dict: dict

Dictionary representation of this quote

property entry: str

Name/ID of the catalogue entry

property entry_str: str

Unformatted string including the supplier, catalogue (if available), and entry name of the quote

property id: int

Returns the quote’s database ID

property lead_time: float

Lead time in days

property price: Price

Price

property purity: float

Purity fraction

property smiles: str

Returns the catalogue SMILES string

property supplier: str

Name of the supplier

property type: str

Description of this quote

class hippo.price.Price(amount, currency)[source]

Class to represent a certain amount of currency. Supported currencies:

CURRENCIES = {
        'USD':'$',
        'EUR':'€',
        'GBP':'£',
}
self + other: Price Price[source]

Add two Price objects

Parameters:

otherPrice object

Returns:

Price object

self == other: Price bool[source]

Compare two Price objects

self > other: Price bool[source]

Compare two Price objects

self < other: Price bool[source]

Compare two Price objects

self * other: Price | float | int Price | float[source]

Multiply this Price by another object

Parameters:

otherPrice or float or int

Returns:

Price object or float

repr(self) str[source]

ANSI Formatted string representation

str(self) str[source]

Unformatted string representation

self / other: Price | float | int Price | float[source]

Divide this Price by another object

Parameters:

otherPrice or float or int

Returns:

Price object or float

property amount: float

Amount

copy() Price[source]

Return a copy of this Price

property currency: str

Currency string

classmethod from_dict(d: dict) Price[source]

Create a Price object from a dictionary:

dict(amount: float, currency: str)
Parameters:

d – dictionary in the above format:

get_dict() dict[source]

Dictionary in the format:

dict(amount: float, currency: str)
property is_null: bool

Is this Price.null() or zero?

classmethod null() Price[source]

Zero in any currency

property symbol: str

Currency symbol