import pandas as pd

# Replace with your published CSV link
CSV_URL = "https://docs.google.com/spreadsheets/d/1QIjIZFJKeBBclNrIc1msx1dFTja5ZmGKhgFaiVcU3hY/export?format=csv"

def get_all_saas():
    try:
        df = pd.read_csv(CSV_URL)
        return df.to_dict(orient="records")
    except Exception as e:
        print(f"Error fetching SaaS data: {e}")
        return []

def get_saas(name):
    all_saas = get_all_saas()
    for saas in all_saas:
        if str(saas['Name']).lower() == name.lower():
            return saas
    return None