# xlwings Lite

**xlwings Lite lets you automate Excel and build native custom functions in Python.<br>
Free, cross-platform, and without installing Python.**

![Microsoft logo](images/microsoft-logo.svg) [Microsoft Marketplace](https://marketplace.microsoft.com/en-us/product/WA200008175?tab=Reviews) · **★★★★★** **5.0** · 43 ratings

![xlwings Lite running a seaborn example in Excel](images/seaborn_example_cropped.png)
> “I have used lots of ways to have user functions in Excel over the years: VBA, C and C++ XLLs and DLLs. […] xlwings Lite has basically fulfilled all my wishes. It’s like having the flexibility and ease of VBA but in a language with so much more potential. And this app is free!”

> — **Antoine Marmoiton**, [Microsoft Marketplace review](https://marketplace.microsoft.com/en-us/product/WA200008175?tab=Reviews)

[Install from the Office add-in store](https://appsource.microsoft.com/en-us/product/office/WA200008175). It’s free for personal and commercial use, with no registration or login required. See [Getting Started](getting-started.md) for step-by-step instructions and a video walkthrough.

After installation, `main.py` already contains sample code, so you can get started right away:

### Custom function

```python
@func
def hello(name):
    return f"Hello {name}!"
```

Type `=HELLO("World")` into a cell and you’ll get back `Hello World!`—a native Excel custom function, written in Python.

### Script

```python
@script
def hello_world(book: xw.Book):
    book.sheets.active["A1"].value = "Hello World!"
```

Click on the green **Run Hello World** button (or hit `F5`).

## Why xlwings Lite

- **No Python installation required**: Python runs via [Pyodide](https://pyodide.org) inside the browser runtime used by modern Office add-ins.
- **[Cross-platform](getting-started.md#prerequisites)**: Works on Windows, macOS, and Excel for the web. It’s compatible with Microsoft 365 as well as perpetual versions of Office from 2021 onward.
- **No service quotas**: There are no execution quotas, throttling, or per-user usage limits.
- **[Built on a proven foundation](about.md)**: xlwings Lite is based on xlwings, the open-source package that has been around since 2014.

## What you can do

- **[Custom functions](custom-functions.md)**: Define native user-defined functions (UDFs) that you call directly from a cell.
- **[Scripts](custom-scripts.md)**: Automate Excel (e.g., insert a sheet or color a cell) by running Python scripts at the click of a button.
- **[Notebooks](notebooks.md)**: As in Jupyter notebooks, write and run code cell by cell, with support for modern plotting libraries such as Matplotlib, seaborn, Plotly, Bokeh, and Altair.
- **[Install packages](dependencies.md)**: Use libraries like pandas, Polars, DuckDB, or your own Python packages.
- **[Web API access](web-requests.md)**: Fetch data directly from APIs.
- **[App Mode](app-mode.md)**: Turn a workbook into an app for end users. The code editor is hidden and each script becomes a button with auto-generated form fields.

## Developer experience

- **[VS Code editor](editor.md)**: xlwings Lite uses the same editor that powers VS Code, including many of its familiar keyboard shortcuts.
- **[Testing with pytest](tests.md)**: A built-in pytest runner lets you write automated tests for your Python code as well as for the workbook itself.
- **[Personal modules](personal-modules.md)**: Share Python files and packages across all your workbooks, similar to VBA’s `Personal.xlsb`. You can also track them with Git.
- **Wingman AI assistant**: Write and explain code with a built-in AI chat, plus the `=WINGMAN()` custom function. Bring your own API key for Claude, Gemini, OpenAI, or a self-hosted model.
- **Standard Python files**: Organize your code using regular `.py` modules, functions, and imports.
- **A path beyond WebAssembly**: If you outgrow the browser’s [Limitations](limitations.md), you can reuse the core xlwings API with the [local version of xlwings](https://docs.xlwings.org) or [xlwings Server](https://server.xlwings.org), usually with little or no code changes.

## Privacy, security & distribution

- **[Local-first](security.md)**: Python runs on your own computer.
- **Code you control**: Workbook code runs only after you approve it, with a view-only option for inspecting untrusted workbooks.
- **Easy distribution**: Python code is stored inside the workbook, making the xlwings Lite add-in the only requirement to run your workbook.
- **[Self-hosting](self-hosting.md)**: For maximum control, deploy xlwings Lite on your own infrastructure behind your firewall.
