formulas
Parse and compile Excel formulas and workbooks in python code.
What it is and what it does
Formulas is an interpreter that reads Excel formulas and workbooks, parses them into an abstract syntax tree, and compiles them into Python functions that can be executed independently of Excel. It handles both individual formula expressions and complete workbook models, including cell references, dependencies, and circular references. The package includes a command-line interface for calculating workbooks, converting them to portable JSON representations, testing them, and even exposing them as HTTP APIs.
The core use case is extracting computational logic from Excel spreadsheets into Python without needing Excel installed or using COM servers. It depends on numpy, scipy, schedula (for dependency resolution), and several utility libraries. The package is actively maintained and supports Python 3.6 through 3.13.
Use it for:
- Extract and execute a single Excel formula in Python without loading the entire workbook
- Load an Excel workbook, override input values, and calculate specific output cells programmatically
- Convert an Excel model to a JSON file for version control and inspection without the original workbook
- Compile an Excel workbook into a reusable Python function with fixed inputs and outputs
- Test an Excel workbook directly from the command line to validate formulas and calculations
- Expose an Excel model as a lightweight HTTP API so other applications can execute it remotely
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Parses and compiles Excel formulas and workbooks into executable Python code without requiring Excel itself.
Yes, with license awareness. The package is actively maintained, has no known vulnerabilities, and offers genuine value for teams needing to extract Excel logic into Python without Excel dependencies. The copyleft license (EUPL 1.1+) requires careful review if you plan to distribute derivative works or integrate into proprietary software; internal use is generally safe. Install it if you regularly work with Excel models that need to run in Python environments.
Install
formulas on PyPI
pip
pip install formulasuv
uv add formulaspoetry
poetry add formulasInstalling formulas
Before you install
Low friction install with a pure-Python wheel. Actively maintained as of August 2026 with recent commits and no known vulnerabilities. Depends on common scientific libraries (numpy, scipy, schedula) that are well-established.
License in practice
Licensed under EUPL 1.1+ (copyleft). Users must comply with copyleft obligations when distributing derivative works; proprietary use requires careful review of license terms.
Quickstart
pip install formulas
import formulas
func = formulas.Parser().ast('=(1 + 1) + B3 / A2')[1].compile()
result = func(1, 5) # Pass values for A2, B3
Verify before relying
- Whether all Excel functions are supported or only a subset
- Performance characteristics when handling large workbooks with many dependencies
- Exact scope of circular reference handling mentioned in docs
Package facts
| License | EUPL 1.1+ (copyleft) |
| Python support | not specified |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 8 — click, regex, schedula, numpy, python-dateutil, numpy-financial, scipy, tqdm |
| Maintenance | actively maintained — 156 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 3,322,303/month — #2,661 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: formulas-1.3.4-py2.py3-none-any.whl
Keywords: python, utility, library, excel, formulas, processing, calculation, dependencies, resolution, scientific, engineering, dispatch, compiling
Tags
More Scientific/Engineering packages
NumPy provides an N-dimensional array object…
permissive · top 100 on PyPI
pandaspandas provides fast, flexible data structures…
permissive · top 100 on PyPI
scipyscipy provides numerical algorithms for…
permissive · top 100 on PyPI
scikit-learnscikit-learn provides a comprehensive Python…
permissive · top 1,000 on PyPI
dilldill extends Python's pickle module to…
permissive · top 1,000 on PyPI
multiprocessMultiprocess is an enhanced fork of Python's…
permissive · top 1,000 on PyPI
bfiA pure-Python interpreter for Brainfuck that…
permissive · top 15,000 on PyPI
xlcalculatorReads MS Excel files and translates Excel…
permissive · top 15,000 on PyPI
xlwingsxlwings lets you call Python from Excel and…
permissive · top 5,000 on PyPI
pycelPycel translates Excel spreadsheets into…
copyleft · top 15,000 on PyPI
spire-xlsSpire.XLS is a compiled Python library for…
unclear · top 15,000 on PyPI
patsyPatsy converts R-style statistical formulas…
permissive · top 1,000 on PyPI
xlsxwriterXlsxWriter creates Excel 2007+ XLSX files from…
permissive · top 1,000 on PyPI
aspose-cells-pythonAspose.Cells for Python via .NET creates,…
unclear · top 15,000 on PyPI
aspose-cellsAspose.Cells for Python via Java is a library…
unclear · top 15,000 on PyPI
formulaicFormulaic converts tabular data into model…
permissive · top 5,000 on PyPI