Spaces:
Sleeping
Sleeping
Update tools/excel_tool.py
Browse files123435656789101112131415import pandas as pdimport requestsfrom io import BytesIO
def analyze_excel(file_path: str) -> str:def analyze_excel(path_or_url: str) -> str: try: df = pd.read_excel(file_path) return df.to_string(index=False) if path_or_url.startswith("http"): response = requests.get(path_or_url) df = pd.read_excel(BytesIO(response.content)) else: df = pd.read_excel(path_or_url) except Exception as e: return f"Error reading Excel file: {e}"
return f"Loaded sheet with shape {df.shape} and columns: {', '.join(df.columns)}"tools/excel_tool.py+10-3