--- id: xlcalculator version: "0.5.0" license: MIT license_treatment: permissive maintenance: active --- # xlcalculator — Converts MS Excel formulas to Python and evaluates them. License: permissive · Maintenance: active · Downloads: 147.5K/mo ## 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 above — 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 pip install xlcalculator uv add xlcalculator 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_current - Install friction: high - Maintenance: active - Downloads: 147.5K/month (top 15,000 on PyPI) - Known vulnerabilities: none known ## Tags excel formula evaluation python, convert excel to python, spreadsheet calculation engine, excel workbook parser, formula translator excel, run excel formulas python, excel without microsoft office, excel-automation, formula-evaluation, financial-modeling [View on SkillFed](https://skillfed.io/packages/xlcalculator) · [View on PyPI](https://pypi.org/project/xlcalculator/)