Bridge Python and Excel

Write, execute, and manage Python code directly within Microsoft Excel workbooks. Full-featured IDE, custom function publishing, package management, and real-time debugging.

Alpha Version
Early stage development - Not for production use
XPyCode IDE Overview

Powerful Features

Everything you need to supercharge Excel with Python

Python Execution in Excel

Run Python code with full access to Excel objects. Manipulate worksheets, ranges, and formatting directly from Python.

Integrated IDE

Monaco-based code editor with IntelliSense, syntax highlighting, and full debugging capabilities.

Package Manager

Install and manage Python packages per workbook with full dependency resolution and version control.

Custom Functions (UDFs)

Publish Python functions as Excel formulas. Use them like any native Excel function.

Event Handling

React to Excel events like worksheet changes and selections with Python callback functions.

Real-time Debugger

Set breakpoints, step through code, and inspect variables with a full-featured debugging experience.

A Complete Development Environment

The XPyCode IDE brings professional development tools directly to your Excel workflow.

  • IntelliSense with auto-completion
  • Syntax highlighting and error detection
  • Project explorer with module management
  • Variable inspector and watch panels
  • Customizable dark and light themes
XPyCode Editor
IntelliSense

How It Works

Get up and running in minutes

1

Install XPyCode

Install the package using pip and start the master server.

pip install xpycode_master
2

Start the Server

Launch the XPyCode Master server which handles communication between Excel and Python.

python -m xpycode_master
3

Open in Excel

Load the XPyCode add-in and launch the development environment.

📍
Navigate to: Add-Ins → More Add-Ins → Shared Folder
🚀
Launch: Open Console → Click <> Editor
4

Write Python Code

Create modules and start writing Python code that interacts with Excel.

def updateExcelFromPython():
    import xpycode
    ws = xpycode.worksheets. getActiveWorksheet()
    rA1 = ws.getRange("A1")
    rA1.values = "Hello"
    rA1.format.fill.color = "yellow"

Architecture

A modular design for flexibility and performance

Excel Add-in

Office.js-based interface

Business Layer

FastAPI message broker

Python IDE

PySide6 + Monaco Editor

Python Kernel

Per-workbook execution environment

Installation

System requirements and quick setup

Requirements

  • 💻
    Operating System

    Windows 10/11 (64-bit)

    Linux/macOS experimental
  • 🐍
    Python

    3.10 or higher

  • 📊
    Microsoft Excel

    2016 or later

    With Office.js Add-in support

Quick Install

Install package:
pip install xpycode_master
Start server:
python -m xpycode_master

The Excel Add-in will be automatically registered.

Ready to supercharge your Excel workflow?

Start using Python in Excel today with XPyCode

⭐ Star us on GitHub to help promote the project