Formualizer Docs
Quickstarts

Pyodide Quickstart

Run formualizer in the browser via Pyodide — install with micropip and evaluate workbook formulas client-side.

Formualizer publishes native CPython wheels to PyPI. Pyodide wheels (*-pyemscripten_<abi>_wasm32.whl) are built and smoke-tested in CI and release workflows, then uploaded only as the wheels-pyodide Actions artifact; they are not uploaded to PyPI or attached to GitHub Releases. The core Formualizer API is available in Pyodide, subject to the platform-specific defaults and runtime limitations noted below.

1) Install in a Pyodide runtime

import micropip
wheel_url = "<your-downloadable-wheel-url>"
await micropip.install(wheel_url)

Download and extract the wheels-pyodide Actions artifact (or build locally), then host the compatible wheel at a browser-accessible URL with suitable CORS headers. Replace wheel_url with that URL, not the artifact ZIP URL. Actions artifacts are retention-limited; no persistent public wheel URL is promised.

2) Evaluate a formula

import formualizer as fz

wb = fz.Workbook()
wb.add_sheet("Sheet1")

wb.set_value("Sheet1", 1, 1, 100)
wb.set_value("Sheet1", 2, 1, 20)
wb.set_formula("Sheet1", 1, 2, "=A1-A2")

result = wb.evaluate_cell("Sheet1", 1, 2)
print(result)  # 80.0

3) Register a Python UDF

wb.register_function(
    "py_add",
    lambda a, b: a + b,
    min_args=2,
    max_args=2,
)
wb.set_value("Sheet1", 1, 1, 20)
wb.set_value("Sheet1", 2, 1, 22)
wb.set_formula("Sheet1", 1, 2, "=PY_ADD(A1, A2)")
wb.evaluate_cell("Sheet1", 1, 2)  # 42

Single-cell references arrive as scalars in the callback, matching Excel semantics.

4) Round-trip an XLSX file

xlsx_bytes = wb.to_xlsx_bytes()
# ... send to browser download, IndexedDB, fetch upload, etc.

restored = fz.load_workbook_bytes(xlsx_bytes)
restored.evaluate_cell("Sheet1", 1, 2)

Tested Pyodide target

The CI and release smoke paths currently use Pyodide 314.0.7 (Python 3.14) and the wheel's derived platform tag (currently pyemscripten_2026_0_wasm32). The wheel does not install in Pyodide 0.29.x. Rebuild and smoke-test a wheel when targeting another runtime.

Pyodide-specific behavior

  • EvaluationConfig() and Workbook() default enable_parallel = False on sys.platform == "emscripten". Pyodide has no threads; the flag remains available but falls back to single-threaded execution.
  • XLSX byte loading (from_bytes, load_workbook_bytes) defaults to native, including Pyodide. backend="calamine" is a native compatibility alias. Explicit umya rich reading and to_xlsx_bytes remain supported.
  • Source-preserving cache recalculation is available as fz.recalculate_xlsx_bytes(data), with the same result as on native CPython (the formualizer recalc CLI and recalculate_xlsx_file are not available). Pyodide has no system clock: a workbook using TODAY or NOW is refused unless you pass deterministic_timestamp_utc=datetime(..., tzinfo=timezone.utc).
  • Everything else — parse, evaluate, spill, custom functions, undo/redo, SheetPort — behaves identically to native CPython.

Next

On this page