Python in Excel: WebAssembly for local execution replaces cloud connection
The Anaconda Toolbox for Excel offers an extension to run Python code from Excel on your own computer instead of in the Microsoft cloud.
(Image: Bild erstellt mit KI durch iX / rme)
Anaconda, the company behind the Python distribution of the same name, has announced a new Python extension for Excel. Anaconda Code makes it possible to execute Python code from Excel on your own computer.
The extension, which is part of the Anaconda Toolbox, closes a gap in Python for Excel, which Anaconda introduced in partnership with Microsoft in 2023. The fact that Python for Excel does not execute the code locally, but in the Microsoft cloud, was a point of criticism of the extension.
Videos by heise
Locally with WebAssembly
To execute the code directly on the computer, Anaconda Code relies on PyScript. The project presented for the first time at PyCon 2022 also comes from Anaconda. It uses WebAssembly for integration into the browser. This allows the Python code to be executed directly in a browser-based Excel add-in.
PyScript is based on Pyodide, a project originally launched by Mozilla for Python applications in the browser. By default, Anaconda Code uses the current Pyodide release, but the version can be customized, as can the integrated Python packages. However, the documentation points out that some compiled packages are not compatible with PyScript's WebAssembly engine.
(Image:Â Anaconda)
The heart of Anaconda Code is the dashboard. From there, the code for a cell can be entered, edited and executed, and a section of the spreadsheet can be linked to the code. For example, the command
to_array(REF(<EXCEL_RANGE>))
creates a NumPy array from an Excel range.
The Workbook Settings offer further configuration options. Among other things, the "Run Isolated" mode means that the code runs individually for each cell and has no access to variables defined in other cells. In contrast, in "Run Linked" mode, variables from one cell are available in subsequent linked cells.
Toolbox in the cloud
However, it is not possible without the cloud: The extension is part of the Anaconda Toolbox for Excel, which requires an Anaconda.cloud account. In addition to Anaconda Code, the toolbox contains connectors for sharing data in Excel and notebooks in the Anaconda.cloud, a tool for creating and sharing code snippets and a tool for creating visualizations.
The toolbox also offers a ChatGPT-like AI assistant that responds to prompts, for example to generate Python code for a specific task or to create and interactively customize a chart from a table area.
(Image:Â Anaconda)
During the beta, the Anaconda Toolbox, which is available via Microsoft AppSource, can be tested free of charge.
(rme)