def get_resource_data(database, id_data):
    """ Get resource data by id """
    data_database = database['contributions']['data']
    crt_data = [x for x in data_database if x['public_id'] == id_data]
    if len(crt_data) == 0: raise Exception("Not contribution found with this id")
    crt_data = crt_data[0]
    return crt_data