skillfed

xlcalculator

Converts MS Excel formulas to Python and evaluates them.

xlcalculator v0.5.0 147.5K downloads/30d#11,061 on PyPI162
Permissive license MIT Active released

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 xlcalculator

uv

uv add xlcalculator

poetry

poetry add xlcalculator

Installing 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

Development Status :: 5 - Production/StableIntended Audience :: DevelopersIntended Audience :: Financial and Insurance IndustryIntended Audience :: Information TechnologyIntended Audience :: Science/ResearchLicense :: OSI Approved :: MIT LicenseNatural Language :: EnglishOperating System :: OS IndependentProgramming Language :: Python :: 3Programming Language :: Python :: 3.10Programming Language :: Python :: 3.9Topic :: Office/Business :: Financial :: SpreadsheetTopic :: Scientific/EngineeringTopic :: Scientific/Engineering :: Information AnalysisTopic :: Scientific/Engineering :: MathematicsTopic :: Software Development :: LibrariesTopic :: Software Development :: Libraries :: Python ModulesTopic :: Software Development :: TestingTopic :: Software Development :: Testing :: UnitTopic :: Utilities

Tags

excel formula evaluation pythonconvert excel to pythonspreadsheet calculation engineexcel workbook parserformula translator excelrun excel formulas pythonexcel without microsoft office
excel-automationformula-evaluationfinancial-modeling

More Libraries packages