import requests
import json


def select_other(product):
    """
    Description
    ----
    Returns all Futures, Moneymarkets or Options based on the
    value you give to the input parameter.

    Input
    ----
    product (string)
        Gives all data for a specific product.

    Output
    ----
    json_data (dictionary)
        Returns a dictionary with a selection or all data based on the input.
    """
    URL = ("https://raw.githubusercontent.com/JerBouma/FinanceDatabase/master/"
           "Database/Other/")

    if product not in ['Futures', 'Moneymarkets', 'Options']:
        raise ValueError(f"{product} is not available. Only 'Futures', 'Moneymarkets' and 'Options'.")

    try:
        json_file = URL + product + ".json"
        request = requests.get(json_file)
        json_data = json.loads(request.text)
    except json.decoder.JSONDecodeError:
        raise ValueError(f"Not able to find any data with type {product}.")

    return json_data