from . import organisations_json

def organistations_return_names():
    ol = organisations_json.organisations_list
    return [school["naam"] for school in ol["organisations"]]

def organisations_return_search(search):
    ol = organisations_json.organisations_list
    search = search.lower()
    return [
        school["naam"]
        for school in ol["organisations"]
        if search in school["naam"].lower()
    ]
    
def organisations_return_uuid(needed_uuid):
    ol = organisations_json.organisations_list
    for school in ol["organisations"]:  
        if school["naam"].lower() == needed_uuid.lower():
            return school["uuid"]
        
    return None