xlwings
Make Excel fly: Interact with Excel from Python and vice versa.
What it is and what it does
xlwings is a Python library that bridges Excel and Python, letting you automate Excel workbooks from Python scripts and replace VBA macros with Python code. It provides a syntax close to VBA for reading, writing, and manipulating Excel objects, and supports numpy arrays and pandas DataFrames natively for data exchange. The open-source version (this package) includes scripting, macro replacement, and UDF support on Windows; it works on Windows and macOS and requires a local Excel installation.
The package has been maintained since 2014 and is actively developed. It depends on pywin32 for Windows integration, psutil for system utilities, and appscript for macOS support. The PRO tier adds server-based deployment, template-based reporting, and faster Excel reading, but those features are not included in this open-source distribution.
Use it for:
- Automate repetitive Excel tasks—opening workbooks, populating cells, running calculations—from Python without writing VBA.
- Replace legacy VBA macros with Python code for better maintainability, testing, and version control.
- Build Python-based user-defined functions (UDFs) for Excel on Windows, letting spreadsheet users call Python logic directly from cells.
- Exchange data between Python and Excel—read pandas DataFrames from workbooks or write analysis results back to spreadsheets.
- Integrate Excel into Python data pipelines, treating workbooks as data sources or outputs in a larger automation workflow.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
xlwings lets you call Python from Excel and vice versa, automating Excel workbooks with Python code instead of VBA, and writing Python-based user-defined functions for spreadsheets.
Yes. xlwings is actively maintained, has low install friction, carries a permissive BSD license, and solves a real problem—bridging Excel and Python without VBA. It's in the top 5000 PyPI packages by downloads. Install it if you need to automate Excel from Python or replace VBA macros; skip it only if you don't use Excel or prefer server-based alternatives.
Install
xlwings on PyPI
pip
pip install xlwingsuv
uv add xlwingspoetry
poetry add xlwingsInstalling xlwings
Before you install
Low install friction with a pure-wheel distribution. Active maintenance—released 4 days ago with a commit history through 2026-08-14. Depends on pywin32, psutil, and appscript, which are standard system-integration libraries.
License in practice
BSD 3-clause permissive license on the open-source package. The PRO tier is dual-licensed under PolyForm Noncommercial (free for noncommercial use) or a commercial license requiring a paid plan; this package is the open-source base without PRO features.
Quickstart
pip install xlwings
import xlwings as xw
wb = xw.Book('myfile.xlsx')
ws = wb.sheets[0]
ws['A1'].value = 'Hello from Python'
Requires an Excel installation (Windows or macOS); pywin32 on Windows requires Visual C++ build tools or a pre-built wheel.
Verify before relying
- Whether numpy and pandas integration works out-of-the-box or requires those packages to be installed separately.
- Whether UDF support (Windows-only per description) is included in this open-source version or requires PRO.
- Specific macOS and Windows version compatibility beyond Python 3.9+.
Package facts
| License | BSD 3-clause (permissive) |
| Python support | supports the current Python release (>=3.9) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 3 — pywin32, psutil, appscript |
| Maintenance | actively maintained — 4 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 990,223/month — #4,563 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: xlwings-0.36.14-py3-none-any.whl
Keywords: xls, excel, spreadsheet, workbook, vba, macro
Tags
More Spreadsheet packages
gspread provides a Python interface to read,…
permissive · top 1,000 on PyPI
streamlitStreamlit transforms Python scripts into…
permissive · top 1,000 on PyPI
xlwtGenerates Microsoft Excel 97–2003 XLS…
permissive · top 5,000 on PyPI
dashDash is a Python framework for building…
permissive · top 5,000 on PyPI
numpy-financialProvides elementary financial functions (IRR,…
permissive · top 5,000 on PyPI
gspread-dataframeConverts between Google Sheets worksheets and…
permissive · top 5,000 on PyPI
excelrdExtracts data from Microsoft Excel spreadsheet…
permissive · top 15,000 on PyPI
formulasParses and compiles Excel formulas and…
copyleft · top 5,000 on PyPI
xlcalculatorReads MS Excel files and translates Excel…
permissive · top 15,000 on PyPI
openpyxlopenpyxl reads and writes Excel 2010…
permissive · top 1,000 on PyPI
xlrd3Reads data from Excel spreadsheet files (.xls…
permissive · top 15,000 on PyPI
xlsxwriterXlsxWriter creates Excel 2007+ XLSX files from…
permissive · top 1,000 on PyPI
spire-xlsSpire.XLS is a compiled Python library for…
unclear · top 15,000 on PyPI
pycelPycel translates Excel spreadsheets into…
copyleft · top 15,000 on PyPI
xlrdxlrd reads data and formatting information from…
permissive · top 1,000 on PyPI