xlcalculator
Converts MS Excel formulas to Python and evaluates them.
What it is and what it does
xlcalculator is a Python library that parses MS Excel workbooks and translates their formulas into executable Python code, then evaluates those formulas to produce results. It's a modernization of the koala2 library, designed for scenarios where you need to run spreadsheet calculations programmatically without requiring Excel itself. The library supports loading and saving workbook state, evaluating individual cells or named ranges, and extracting sub-portions of models for focused calculation.
The package supports a subset of Excel functions—including date/time, engineering, financial, and mathematical operations—but has known limitations: it does not support array formulas, some functions like EXP and DB are not implemented, and certain functions like VLOOKUP work only in exact-match mode. Numeric precision follows Excel's floating-point behavior where possible, though perfect parity is not guaranteed. The library is actively maintained and suitable for financial modeling, scenario analysis, and unit testing of spreadsheet logic.
Use it for:
- Automate financial model calculations by loading an Excel workbook and evaluating formulas programmatically without Excel installed.
- Unit test spreadsheet formulas directly by parsing a workbook and asserting on cell values or named range results.
- Build scenario analysis tools that read Excel templates and re-evaluate them with different input values.
- Migrate legacy spreadsheet-based calculations into Python applications while preserving formula logic.
- Audit spreadsheet models by extracting and evaluating specific cell ranges or named definitions.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Reads MS Excel files and translates Excel formulas into Python code for evaluation, allowing spreadsheet calculations to run without Excel.
Yes, with conditions. The package is actively maintained, has no known vulnerabilities, and is suitable for production use in financial and data analysis workflows. However, high install friction and the gap since the last release warrant checking that your target Excel functions are supported and testing numeric precision on your specific workbooks before committing to it.
Install
xlcalculator on PyPI
pip
pip install xlcalculatoruv
uv add xlcalculatorpoetry
poetry add xlcalculatorInstalling xlcalculator
Before you install
High install friction: the package is distributed as a source tarball with no pre-built wheels. Maintenance is active with recent commits, though the last release was in 2023 despite ongoing repository activity.
License in practice
MIT license is permissive and poses no restrictions on commercial or private use, modification, or redistribution.
Quickstart
pip install xlcalculator
from xlcalculator import ModelCompiler
compiler = ModelCompiler()
model = compiler.read_and_parse_archive('workbook.xlsx')
evaluator = model.evaluator
result = evaluator.evaluate('Sheet1!A1')
Requires Python 3.9 or later. Source installation may require a C compiler and development headers.
Verify before relying
- Whether the package handles all Excel function types needed for your workbook, given documented limitations on array formulas and some function implementations.
- Performance characteristics when evaluating large workbooks or complex formula chains.
- Numeric precision behavior for edge cases beyond the documented floating-point discussion.
- Current state of function support, as the last release was 2023-02-06.
Package facts
| License | MIT (permissive) |
| Python support | supports the current Python release (>=3.9) |
| Install friction | high — source build required |
| Runtime dependencies | none |
| Maintenance | actively maintained — 1,285 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 147,546/month — #11,061 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: xlcalculator-0.5.0.tar.gz
Keywords: xls, Excel, spreadsheet, workbook, data analysis, analysisreading excel, excel formula, excel formulas, excel equations, excel equation, formula, formulas, equation, equations, timeseries, time series, research, scenario analysis, scenario, modelling, model, unit testing, testing, audit, calculation, evaluation, data science, openpyxl
Tags
More Libraries packages
urllib3 is an HTTP client library that provides…
permissive · top 100 on PyPI
requestsRequests is a Python HTTP library that…
permissive · top 100 on PyPI
pluggyPluggy provides a plugin system that lets you…
permissive · top 100 on PyPI
python-dateutilProvides parsing, arithmetic, and recurrence…
permissive · top 100 on PyPI
sixSix provides utility functions to write Python…
permissive · top 100 on PyPI
pytestpytest is a testing framework that lets you…
permissive · top 100 on PyPI
formulasParses and compiles Excel formulas and…
copyleft · top 5,000 on PyPI
pycelPycel translates Excel spreadsheets into…
copyleft · top 15,000 on PyPI
xlwingsxlwings lets you call Python from Excel and…
permissive · top 5,000 on PyPI
spire-xlsSpire.XLS is a compiled Python library for…
unclear · top 15,000 on PyPI
xlrdxlrd reads data and formatting information from…
permissive · top 1,000 on PyPI
xlrd3Reads data from Excel spreadsheet files (.xls…
permissive · top 15,000 on PyPI
ssfFormats numbers and dates using ECMA-376…
permissive · top 5,000 on PyPI
excelrdExtracts data from Microsoft Excel spreadsheet…
permissive · top 15,000 on PyPI
python-calamineReads Excel and ODF spreadsheet files via a…
permissive · top 5,000 on PyPI
powerfxProvides a Python bridge to invoke C# Power Fx…
permissive · top 15,000 on PyPI