top of page

xlwings lite |Connect to Remote Databases

Updated: 7 days ago




Automate, pull, analyze, report, chart, model.


Check out dedicated xlwings LIte section on REX AI Co Analyst site
Full templates
How-to guides
Backend code
Technical breakdowns
Resource Links

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



ย 
ย 

Recent Posts

See All
bottom of page