xlwings lite |Connect to Remote Databases
- Amar Harolikar
- Apr 7
- 3 min read
Updated: 7 days ago
Automate, pull, analyze, report, chart, model.
Python in Excel: with a mini code editor sitting inside Excel, a robust Excel objects model and a simple setup, xlwings Lite has nailed it. One of my primary tools now โ alongwith Colab, Cursor, and Jupyter+Mito AI.
In this Part 2 on xlwings Lite, I show another powerful feature โ API callsโฆlets you connect to any external system with API access.
๐๐ง ๐ญ๐ก๐ข๐ฌ ๐๐๐ฆ๐จ: connect to a remote Postgres database, explore tables, pull records, and run custom SQL โ all from Excel, using a simple spreadsheet interface. Excellent for automated data pulls and DB updates too.
Once data is pulled, we run exploratory data analysis with extended descriptive stats, frequency tables, distribution plots, charts โ followed by an XGBoost response model with evaluation sheet, decile table, ROC/Gains chart, and scoring.
This is demo with mock data, but ๐ฌ๐ก๐จ๐ฐ๐ฌ ๐ก๐จ๐ฐ ๐ฑ๐ฅ๐ฐ๐ข๐ง๐ ๐ฌ ๐๐ข๐ญ๐ ๐ก๐๐ง๐๐ฅ๐๐ฌ:
โ Complex Python workflows
โ External system connections via API
โ Remote database connections
โ Excel object manipulation โ sheets, rows, columns
โ Advanced automation
โ Excel-based tools with Excel as the UI
โ Custom tables, reports, and charts
โ Statistical analysis
โ Machine learning model builds
๐๐๐ฆ๐จ๐ญ๐ ๐๐ ๐๐จ๐ง๐ง๐๐๐ญ๐ข๐จ๐ง๐ฌ
Requires a web layer โ easy to manage. I use a custom built FastAPI server (open source), which youโre free to use (just note: your credentials would pass through my server) โ or you can deploy your own. Takes just a few minutes on Render. Itโs a reusable component I use to connect any frontend or UI to backend databases. Iโve covered this in earlier posts and videos โ links in comments
๐๐๐ ๐๐๐ฅ๐ฅ๐ฌ ๐ญ๐จ ๐๐๐๐ฌ
Not covered in this video, but Iโve also tested API calls to OpenAI, Gemini, and Claude Sonnet using JSON schemas for structured output. Big deal for automation. Planning to cover this in a future part. But itโs essentially the same โ straightforward API call, parse the response, use it in your workflow.
๐๐ง๐ฌ๐ญ๐ซ๐ฎ๐๐ญ๐ข๐จ๐ง๐ฌ ๐๐จ๐ซ ๐๐ ๐๐จ๐๐๐ซ๐ฌ / ๐๐๐๐ฌ
For humans too. In my Github Repo.
๐ฑ๐ฅ๐ฐ๐ข๐ง๐ ๐ฌ ๐๐ข๐ญ๐
From Felix Zumstein, creator of the original xlwings โ a solid, established Python package for Excel automation. Heโs laid out a strong roadmap and shared excellent documentation covering usage, API reference, limitations, and comparisons with other Python-in-Excel tools.
https://lite.xlwings.org
๐๐ข๐๐๐จ
Full 20 minute video on YouTube with timestamps: Demo, Caveats, FastAPI setup & Code Walkthrough
https://youtu.be/6Vmzd4sHcxY
* โ โ โ โ * โ โ โ โ *
๐๐ ๐๐จ-๐๐ง๐๐ฅ๐ฒ๐ฌ๐ญ: explore 15+ open-source AI analytics apps at rex.tigzig.com -๐นAI Advanced Analysis App: https://lnkd.in/g8xPQvb8
๐นAI Automation Micro App โ Fund Disclosures Excel to CSV https://lnkd.in/gxVbCdpv
๐๐ข๐ญ๐๐ฎ๐ ๐ซ๐๐ฉ๐จ with demo files and scripts for xlwings Lite
https://lnkd.in/gZVaZzvD
FastAPI Server โ Latest Code
https://github.com/amararun/shared-fastapi-rex-db-coolify
FastAPI Server โ How to Deploy on Render
https://lnkd.in/g2A9h8f2
This guide shows how to connect ChatGPT with Supabase. The Render deployment steps are the same โ just use the latest code (above). No environment variables needed. For live use cases, API keys and additional security advised.
Get free Postgres / MySQL database quickly
neon.tech โ Postgres database, instantly available. 500MB free.
Supabase โ Postgres with auth, API, storage. 500MB free tier.
Aiven โ Postgres and MySQL. 5GB free tier.
Upload data with DBeaver / rex.tigzig.com