formulas: An Excel formulas interpreter in Python.

Latest Version in PyPI Build status Code coverage Documentation status Total Downloads Downloads per Month Issues count Supported Python versions Project License Live Demo

release:

1.3.4

date:

2026-03-11 18:35:00

repository:

https://github.com/vinci1it2000/formulas

pypi-repo:

https://pypi.org/project/formulas/

docs:

http://formulas.readthedocs.io/

wiki:

https://github.com/vinci1it2000/formulas/wiki/

download:

http://github.com/vinci1it2000/formulas/releases/

donate:

https://donorbox.org/formulas

keywords:

excel, formulas, interpreter, compiler, dispatch

developers:
license:

EUPL 1.1+

What is formulas?

formulas implements an interpreter for Excel formulas, which parses and compile Excel formulas expressions.

Moreover, it compiles Excel workbooks to python and executes without using the Excel COM server. Hence, Excel is not needed.

Installation

To install it use (with root privileges):

$ pip install formulas

Or download the last git version and use (with root privileges):

$ python setup.py install

Install extras

Some additional functionality is enabled installing the following extras:

  • excel: enables to compile Excel workbooks to python and execute using: ExcelModel.

  • plot: enables to plot the formula ast and the Excel model.

To install formulas and all extras, do:

$ pip install formulas[all]

Development version

To help with the testing and the development of formulas, you can install the development version:

$ pip install https://github.com/vinci1it2000/formulas/archive/dev.zip

CLI Quickstart

The formulas command-line interface works with spreadsheet models and accepts .xlsx, .ods, and .json inputs.

A typical workflow starts by calculating a workbook. You can override input values directly from the command line and request specific cells to be rendered in the output.

$ formulas calc test/test_files/excel.xlsx \
    --overwrite "'[excel.xlsx]'!INPUT_A=3" \
    --overwrite "'[excel.xlsx]DATA'!B3=1" \
    --render "'[excel.xlsx]DATA'!C2=result" \
    --output-format json

Spreadsheet models can also be converted into a portable JSON representation. This is useful when the model needs to be versioned, inspected, or executed without the original workbook.

$ formulas build test/test_files/excel.xlsx \
    --output-file model.json

For validation purposes, a workbook can be tested directly from the CLI. The following command runs the tests and prints a short summary.

$ formulas test test/test_files/excel.xlsx --summary

Finally, a model can be exposed as a lightweight HTTP API, allowing other applications to execute it remotely. The serve command requires the optional web dependencies (pip install formulas[web]).

$ formulas serve test/test_files/excel.xlsx \
    --host 127.0.0.1 \
    --port 5000

Each command provides additional options and examples through the built-in help system:

$ formulas COMMAND --help

Table of Contents

Indices and tables