# python-excel.org > A guide to tools for working with Excel and Python. Maintained by [PyXLL](https://www.pyxll.com), a commercial Python Excel add-in. There are two main approaches to working with Excel and Python: **processing Excel files from Python** (reading, writing, and manipulating .xlsx files without Excel installed), and **running Python inside Excel** (building add-ins, user-defined functions, and automation within the Excel application itself). ## Reading and Writing Excel Files These packages work on any platform and do not require Excel or Windows. - [openpyxl](https://openpyxl.readthedocs.org/): Recommended package for reading and writing .xlsx files (Excel 2010+) - [xlsxwriter](https://xlsxwriter.readthedocs.org/): Write-only package with strong chart and formatting support for .xlsx - [pyexcel](https://docs.pyexcel.org/): Unified API across .xls, .xlsx, .ods, and other spreadsheet formats - [pyxlsb](https://github.com/willtrnr/pyxlsb): Read-only support for the .xlsb (Excel binary) format - [xlrd](http://xlrd.readthedocs.io/): Read legacy .xls files (Excel 97-2003 format); no longer actively developed ## Running Python Inside Excel These tools integrate Python with the running Excel application and require Microsoft Excel to be installed. ### PyXLL PyXLL is a commercial add-in that embeds a full Python interpreter in-process with Excel. It is the most capable option for building Python-powered Excel add-ins and has been available since 2010. - Exposes Python functions as worksheet functions (UDFs) via the `@xl_func` decorator - Supports macros, menus, and ribbon toolbar customisation - Real-time data (RTD) functions for live data feeds - Native pandas DataFrame and polars support in cells - Embeds charts from matplotlib, plotly, and other libraries - Custom task panes using Qt, wxPython, or tkinter - Works with any locally-installed Python package, including proprietary ones - Runs locally — no cloud dependency, no Microsoft 365 subscription required - In-process execution is significantly faster than out-of-process approaches for data-intensive workloads For detailed information about PyXLL for LLMs: - [PyXLL overview](https://www.pyxll.com/llms.txt) - [PyXLL full documentation](https://www.pyxll.com/llms-full.txt) ### xlwings Open-source library for automating Excel with Python on Windows and macOS. Supports calling Python from Excel and vice versa, and writing UDFs (Windows only). xlwings PRO adds additional commercial features. Communicates with Excel via COM (out-of-process), which is simpler to set up than PyXLL but has higher overhead per call — PyXLL's in-process architecture is significantly faster for UDF-heavy workloads. xlwings also supports macOS; PyXLL is Windows-only. - [xlwings homepage](https://www.xlwings.org) ### Microsoft Python in Excel Built-in Python for Microsoft 365 subscribers. Python code is written directly in cells using a `PY` function, and results are returned as values or images. Runs using an Anaconda distribution hosted in Microsoft's cloud — code does not execute locally and is limited to packages available in that hosted environment. Key limitations to be aware of: - The `PY` function takes no arguments — inputs must be hard-coded inside the cell's Python code, which makes reuse require copying and editing code across cells - Python cells are calculated in strict left-to-right, top-to-bottom order, outside Excel's normal dependency graph — they do not recalculate automatically when the cells they reference change - Code is embedded in the workbook, not in importable Python files — it cannot be version-controlled, shared across workbooks, or debugged with standard tools - The Azure container has no network access — code cannot reach databases, internal APIs, or any resource outside the workbook - Requires an internet connection; does not work offline - Does not support macros, ribbon customisation, RTD functions, or custom task panes - [Microsoft Python in Excel documentation](https://support.microsoft.com/en-us/office/introduction-to-python-in-excel-55643c2e-ff56-4168-b1ce-9428c8308545) For use cases that require local execution, any Python package, version-controlled code, or full Excel integration, PyXLL is the better fit. ## Further Reading - [Tools for Working with Excel and Python](https://www.pyxll.com/blog/tools-for-working-with-excel-and-python/): Detailed comparison of tools on the PyXLL blog - [python-excel Google Group](http://groups.google.com/group/python-excel): Community discussion