Pyodide 314.0 is already available in xlwings Lite (the Python in Excel alternative you actually wanted).
HN user
fzumstein
DuckDB also runs in Excel, by the way, via the free xlwings Lite add-in that you can install from the add-in store. It’s using the Python package and allows to write scripts, custom functions, as well as use a Jupyter-like notebook workflow.
Pyodide powers xlwings Lite, a free Excel add-in that you can install from Excel’s add-in store with a single click. It outperforms Microsoft’s official Python in Excel solution in every coceivable way: price, privacy, speed, can install packages, can access the internet, can access local files, doesn’t have a usage quota, can automate Excel and create native UDFs. See https://lite.xlwings.org
Have you tried the CSP build of AlpineJS? It takes the code out of the template into a proper JS file, no unsafe-eval. Isn't state management mostly handled on the backend when you use AlpineJS?
I am not a random user, but the creator. The dependencies are managed via standard requirements.txt file, which is stored in the Excel workbook itself. When you open xlwings Lite with the workbook, the dependencies are installed from either PyPI or Pyodide's own repository (after the first download from the browser's cache).
Direct db queries are indeed a restriction of Wasm/Pyodide, but there are more and more databases offering a HTTP layer. For example, Supabase has this built-in via PostgREST. For Oracle, there is Oracle REST Data Services (ORDS). Ultimately, you can also build your own little proxy server, although that's a little bit more work, but might still be worth it for company-internal use.
No, this is for Excel only, but it does work with the free online version of Excel. I think LibreOffice has support for Python via PyOO.
SQLookup is an Excel add-in that gives you access to the SQLOOKUP function. The SQLOOKUP function allows you to query data in your Excel workbook using SQL (SQLite dialect). The add-in is free and works with Excel on Windows, macOS, and web. It can be installed via the add-in store.
So basically it’s free for 1 day per month (I only use chat).
It's exactly why I built xlwings, to replace VBA with Python. Python in Excel instead is a competitor to the Excel formula language.
No offense taken, and happy that xlwings was an inspiration for creating Row Zero! I don't really buy the security issues though for being the reason for switching from Excel to Row Zero. Yes, Excel has security issues, but so does the cloud, but at least the issues with Excel can be dealt with: disable VBA macros on a company level, run Excel on airgapped computers, etc. Promising that your cloud won't be hacked or is unintentionally leaking information is impossible, no matter how much auditing and certification you're going through. The relatively recent addition of xlwings Server fixes pretty much all of the issues you encountered in your previous company: user don't need a local installation of Python, but the Office admin just pushes an Office.js add-in to them and their done. No sensitive credentials etc. are required to be stored on the end-users computer or spreadsheet either as you can take advantage of SSO and can manage user roles on Microsoft Entra ID (that companies are using already anyways).
As the author of said second class add-in, let me just guess that your most popular feature request was adding the "Import from xlsx" functionality...which describes the whole issue: it's always Excel + something, never something instead of Excel.
xlwings is a competitor to VBA rather than openpyxl: openpyxl can read and write the Excel file on disk, without involving the Excel application. xlwings is all about automating the Excel application, and write macros and custom functions in Python.
Hi all, I am Felix, the author of the post. I just wanted to reiterate that this post was mainly meant as a summary of my GitHub issues I opened with them. So it should really be seen as a feedback to help them improve the product. Python in Excel currently covers a completely different use-case than xlwings, but Python in Excel inspired me to finally look into WASM and PyScript, which is an awesome product.
It's been 10 years. But upload videos very irregularly.
My most obscure video is about programming VBA in VS Code. Other than that, I focus on Python for Excel (no "Python in Excel"): https://www.youtube.com/@xlwings9689
For the Python/Jinja world, there is Jinja2-fragments that allows you to return blocks of the template without having to extract it to partials. I am sure there are similar solutions for other template languages. See https://github.com/sponsfreixes/jinja2-fragments.
Never heard of it either. "Build and share delightful machine learning apps, all in Python." I am wondering what the heck is so special about "machine learning apps" that would differentiate them from any other app that has a UI with a Python backend.
Totally agree on the part of the add-in: Just give us a dead-simple method to load the manifest locally and be done with it!
I don't think that's necessarily true. They built VSTO for C#, but everybody was using ExcelDNA instead, an Open Source solution that was much better!
The same with xlwings (works on macOS, too):
>>> import xlwings as xw
>>> wb = xw.Book()
>>> sh = wb.sheets[0]
>>> sh["A1"].value = "Hello World"Which part do you find difficult? The web backend or the deployment of the Manifest.xml via the app store / office admin?
It's me, yes, are you Michael then ;)? Yeah, I love the Office.js platform, I believe it's the most versatile extension platform there is, it just came out during an unfortunate time (when people believed that you can't use JS without React anymore ;) Anyhow, the magic of Office.js is that you can use it like a JS framework with total freedom what you use on the backend (it's just a fetch call away), so whether that is .NET or Node or Python/R/Julia doesn't matter at all, it's just that the official docs don't really bother to explain that or show an example other than Node & C#. What's a game changer (and only available on Office.js) is the integrated authentication via SSO/Azure AD, which is the first thing any IT department in a corporation is interested in.
Glad I am not the only one with this impression :)
Thanks for your work! The async JS functions are amazing and allowed me to ship rock-solid Custom functions with xlwings and Python. The problem with Office.js is that it’s just simply too hard to get started with all the npm bloat for the average Excel user (even more professional devs struggle). Well, I am pretty happy how I am saving users from having to use Node.js: https://docs.xlwings.org/en/latest/pro/server/officejs_custo...
By it's very nature these Excel documents will be filled with company data, so I can imagine these companies would also be a bit cautious sending those calculations to the cloud, especially if they can't control the flow of data from their I.T. departments via web applications.
This is exactly what I see when talking to users about xlwings: it needs to run on their end, behind their firewall, in exactly the cloud they have picked (AWS, GCP, Azure).
I wish it wasn't solely powered only by Microsoft Cloud and could support python running locally
Have a look at xlwings, which runs on any cloud and also locally.
DataNitro was my inspiration for the Open Source version of xlwings back in 2014. They have been out of business for many years though.
xlwings creator and author of the O'Reilly book "Python for Excel" here! First of all, big congrats to the team! I've been in contact with the Excel team on and off over the years and I remember when an Excel project manager once described the task of adding Python to Excel as "turning a fully loaded ship". Well, I am happy that the ship has now turned and is ready to ship into more exciting waters! There are a few question marks I have given my decade long experience with the topic (although everything is still beta, so it will certainly change/improve on its way to GA):
(1) I have hardly seen any company that can do with an off-the-shelf Anaconda distro. Companies usually have an internal Python package that they will need to access. (2) When running Python on the backend, the first question is always "how can we authenticate the user"? Office.js is currently the only platform I know of that allows you to leverage Azure AD identities via SSO or use any other provider (as you have complete freedom to use any JS library/redirect the user to a login form). (3) IT policies: Usually, companies have made their cloud decision: “We're an AWS/GCP/Azure shop, so Python has to run on precisely AWS Lambda/GCP Cloud Run, etc.” Yes, many are on Azure, but even in Azure they may have preference of let's say Azure Container Apps or AKS instead of Azure functions. (4) The other thing that businesses are obsessed about is to securely protect their source code, again, not something that Python in Excel seems to support. (5) And finally, what I see users most excited about in the context of xlwings is being able to run standard User-defined functions (aka "Custom functions) on the server (like the ones we wrote in the good old VBA times or like the new Lambda functions), not sure if that's possible or on the roadmap for the official version.
With the modern xlwings Server, I have taken a different approach: Let users build a 100% standard Python web app using their favorite framework (Django, Flask, FastAPI, ...) including all the standard tools (logging, auth, etc.) while using Excel as the frontend. Users have complete freedom in choosing their tech stack, they can version-control the source code on GitHub, use GitHub actions to run unit tests and deploy the code automatically to their favorite cloud, etc.
So I am probably targeting more professional developers than data scientists, but in my experience, it’s often a professional developer who write the Excel add-in that is then deployed to business users/data scientists.
We built https://www.xltrail.com to make Excel work with Git.
I am the developer of xlwings, so this is heavily biased. Anyhow, ever since I’ve added support for Google Sheets, I am building all internal tools with it. No HTML/JS/CSS required whatsoever and everybody knows how to interact with a spreadsheet UI. There are a few sample projects on GitHub, e.g., https://github.com/xlwings/xlwings-googlesheets-pandas-plots (they use FastAPI, but it’s trivial to adapt for Flask). On top, Google Sheets let you easily authorize the user on the backend, so you can give certain users read-only access to a database, as an example.