A modular Python–Excel–VBA automation framework for building and deploying User Defined Functions (UDFs), query helpers, and reusable automation workflows. This project centralizes text, table, and data transformation utilities across Excel, Power Query, and Power BI, making it easier to maintain, test, and extend automation logic.
-
Excel–Python UDFs
- Text manipulation (slugify, regex search/replace, string cleaning).
- Table automation (dynamic CSV/PDF loaders, column processors).
- Data validation & formatting helpers.
-
Power Query Function Library
- Pre-packaged M functions with documentation metadata.
- Organized into categories (Text, Table, Regex, Loaders, etc.).
- Auto-folder structure inside Excel (
_fx_queries).
-
Integration Workflows
- VBA macros to register & call Python UDFs.
- Outlook/automation integrations for reporting.
- Power Automate safe testing patterns.
-
Clone the repository
git clone https://github.com/tks18/xlwings_excel_api.git cd xlwings_excel_api -
Install Python dependencies
uv sync
-
Enable the custom add-in in Excel
- Open Excel → File → Options → Add-ins → Excel Addins → Enable.
- Go to Shan's Labs → Import Functions.
- Import the Power Query Function using the search bar in the same tab.
=SLUG_BASIC("Hello World!")
→ hello-world
fx_LoadCSV("C:\data\sales.csv", 200)
-
Each UDF/function includes YAML front-matter for:
name– function namecategory– grouping for folderstags– keywordsdescription– usage notesversion– function version
Example:
---
name: fx_LoadPDFDynamic
category: Table Loaders
tags: [pdf, dynamic, import, columns, table]
description: "Load all pages of a PDF into a flattened table by expanding dynamic columns."
version: "v2.1"
---- Fork the repo.
- Create a feature branch (
api/my-new-func). - Commit changes with descriptive messages.
- Submit a pull request.