r/excel • 8 • 12d ago

Plugin Python embedded in Excel

Hi All,

This weekend for a bit of fun I built a free / source-available Excel add-in which hosts it's own Python runtime.

You can find a feature runtime and installation guide on the website:

https://sancarn.github.io/xll-python/index.html

fork it here: https://github.com/sancarn/xll-python

But here's an overview:

  • You can write user defined functions which execute like formula.
  • Returning a generator will make the result update every time it yield's a result.
  • You can write macros (e.g. reading / writing CSVs/databases from disk etc.)
  • There's an in-built IDE
  • You can debug formula in the IDE
  • There's a console/REPL where you can experiment with the available runtime
  • There's a package manager where you can install pip packages
  • There's a compiler so you can compile your own scripts into standalone .xll addins.

Hope you find this helpful! ~Sancarn

Edit: This project is AI:X. All code written by Astra & Sol 6.2; albeit with a lot of steering.

11 Upvotes

29 comments sorted by

View all comments

Show parent comment

1

u/Double_Cost4865 1 10d ago

I think ArcGIS approach would be better, where you have a single runtime with a single list of dependencies and you use it in all projects. Python version and dependencies don’t change for years. That would make it easier for teams/organisations to align on environments, prepare for migrations between version every X years, and it would save storage/memory and number of processes that need to run even if you have been shared hundreds of workbooks over years, since at most, you only need 1 process running.

1

u/sancarn 8 10d ago

I think there are trade-offs with both approaches. I would recommend if you are in an organisation you use the single xll-python instance, instead of compiling to individual add-ins. What you are describing is the model which unbundled xll-python uses, and you can have 1 repository of custom functions shared across a business.

Separate XLLs give teams more control over what exactly is distributed. An older reporting add-in can stay on pandas 2 while a new forecasting add-in uses pandas 3. If you had 1 shared library across the entire org, you force everyone to use 1 version. Maybe that's okay in small orgs, but in larger orgs I think that'd be challenging.

If there are particular features that you are missing from xll-python which exist in the separate xlls, that's something we can look into otherwise.