def lst2tup(data):
    """Converts output of json.loads to have tuples, not lists.
    """
    if isinstance(data, list):
        return tuple(lst2tup(e) for e in data)
    if isinstance(data, dict):
        return {k: lst2tup(v) for k, v in data.items()}
    return data