Automate workflows with AI Schema Detection
Connect to AI and LLMs for on-the-fly schema detection for automated workflows
xlwings Lite: Automate workflows with AI Schema Detection
Excel app demonstrating how to leverage LLMs for schema detection, automated workflows, and exploratory data analysis using xlwings Lite.
How xlwings Lite Works: The Python code is embedded directly inside the Excel file itself! Download the Excel file from the link below to get the complete app with all code included.
What This App Does
This xlwings Lite app enables you to connect Excel directly to LLM APIs and perform advanced AI-powered analysis:
- Connect to Gemini (2.0-Flash) or OpenAI (GPT-4o) directly from Excel
- Automatic schema detection with structured JSON output
- Identify categorical and numerical variables in data tables
- Generate SQL-compatible data types for database integration
- Perform AI-guided exploratory data analysis (EDA)
- Create data visualizations based on detected schema
- Make API calls using requests/httpx or pyFetch
How to Use
- Download the app and install xlwings Lite from the Add-in button in Excel.
- Add your API keys:
- Gemini: Get free API key from aistudio.google.com (no credit card required)
- OpenAI: Create an API key at platform.openai.com
- Use the built-in functions:
- analyze_table_schema_gemini - Detect column types and data structures with Gemini
- analyze_table_schema_openai - Detect column types and data structures with OpenAI
- perform_eda - Run exploratory data analysis with visualizations in one step
- Customize prompts: Modify the LLM prompts in the code to better suit your specific data requirements.
How It Works
This app leverages xlwings Lite to integrate Excel with LLM APIs, creating an AI-powered analytics environment:
- LLM API integration:
- When you trigger a schema analysis, the app samples your data table
- The sample data is formatted and sent via API to your chosen LLM (Gemini or OpenAI)
- A carefully crafted prompt instructs the LLM to identify column types and return structured JSON
- The JSON response is parsed by Python code and formatted for display in Excel
- Automated workflows:
- The detected schema is used to configure subsequent EDA operations
- Numeric columns receive statistical analysis (mean, median, std, etc.)
- Categorical columns get frequency distributions and charts
- The structured format enables automation of database operations
- This app works best with Gemini's Flash model, which has shown superior performance in schema detection tasks
Practical Use Cases:
- Automated workflows connected to API backends
- Web scraping with results formatted directly in Excel
- AI-enhanced web research with structured output
- Text classification and summarization in spreadsheets
- Text-to-SQL with Excel as the frontend
- Data preparation for database uploads with schema detection
Source Code & Resources
Source Code Location: All Python source code is embedded inside the Excel file! You can download the Excel file with embedded code from the links above.
- xlwings Lite: Official xlwings Lite website with installation instructions and examples.
- xlwings Documentation: Comprehensive documentation with Excel object reference and API documentation.
- Mutual Fund Processor: Live app using schema detection to process mutual fund Excel files with AI-powered column identification.
- TIGZIG Co-Analyst: Database connector app with schema detection for creating tables from uploaded files.
Created by Felix Zumstein, xlwings Lite delivers a powerful and flexible solution for integrating Python with Excel - enabling native Excel support for databases, AI agents, LLMs, advanced analytics, machine learning, APIs, web services, and complete automation workflows.