import pandas as pd
import json

excel_path = r'f:\laravel\job\abality - Copy\public\ABILITY_PRICE_LIST_2026-1.xlsx'

xl = pd.ExcelFile(excel_path, engine='openpyxl')
sheets = xl.sheet_names

sheet_info = {}
for sheet in sheets:
    df = xl.parse(sheet, nrows=5)
    sheet_info[sheet] = {
        "columns": df.columns.tolist(),
        "preview": df.to_dict(orient='records')
    }

with open(r'f:\laravel\job\abality - Copy\scratch\sheets_analysis.json', 'w', encoding='utf-8') as f:
    json.dump(sheet_info, f, ensure_ascii=False, indent=4)

print(f"Sheets found: {sheets}")
