def get_price(data, key):
    """Extracts a price as a float from some data

    Args:
        data (dict): the data containing the price
        key (str): the key of the target price.

    Returns:
        float: the price as a float.

        When the dictionary is missing the requested key, returns :obj:`None`
    """

    price = data.get(key)
    if price is not None:
        price = float(price)

    return price