Pycel is a Python library designed to translate Excel spreadsheets into executable Python code, enabling them to run independently of Excel. It leverages a graph-based representation with caching and lazy evaluation for relatively fast execution. The library also supports visualizing the spreadsheet's dependency graph. It is currently in beta, version 1.0b30, with the last release in October 2021, and its release cadence has been irregular.
pip install pycelVerified import paths — ran on the pinned version, not inferred.
This quickstart demonstrates how to create a simple Excel file, compile it using `pycel.ExcelCompiler`, and then evaluate cell values. It also shows how to dynamically update an input cell and observe the change in a dependent cell, illustrating `pycel`'s evaluation capabilities. The example cleans up the created Excel file afterwards.
Refer to the official GitHub repository for the latest documentation and changelog. Pin specific beta versions if stability is critical.
Understand that Pycel operates as a compiler and evaluator. If you need to write results back to an Excel file, you must use another library (e.g., `openpyxl`) and explicitly save the data.
Extract and translate VBA logic into equivalent Python code. Pycel focuses solely on Excel formulas.
Always call `excel.evaluate()` on at least one output cell of interest to trigger the compilation and graph construction before attempting to visualize or export the graph.
Consult the Pycel documentation or source code for a list of supported functions. If a required function is missing, it may need to be implemented or a workaround devised. For `OFFSET`, ensure all potentially referenced cells are part of the compiled model.
No resource links recorded.