skillfed

xlwings

Make Excel fly: Interact with Excel from Python and vice versa.

xlwings v0.36.14 990.2K downloads/30d#4,563 on PyPI3,395
Permissive license BSD 3-clause Active released

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 xlwings

uv

uv add xlwings

poetry

poetry add xlwings

Installing 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

Development Status :: 4 - BetaLicense :: OSI Approved :: BSD LicenseOperating System :: OS IndependentProgramming Language :: PythonProgramming Language :: Python :: 3Programming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.9Topic :: Office/Business :: Financial :: Spreadsheet

Tags

python excel automationcall python from excelexcel vba replacementpython spreadsheet scriptingexcel macros in pythonpandas dataframe to exceluser defined functions excel
excel-automationvba-replacementoffice-integration

More Spreadsheet packages