Recalculate workbook
recalc_workbookRecalculates .xlsx formulas and saves computed values into every formula cell so readers see results instead of empty cells; returns formula-error and uncomputed-formula summaries.
Instructions
Recalculate an .xlsx file and return it with the computed values saved in every formula cell. Use this after you create or edit a workbook with openpyxl or any other library that writes formulas without results: those files have no cached values, so pandas, openpyxl (data_only=True) and other readers see empty cells until the file is recalculated. Replaces running LibreOffice recalc.py. Returns the file plus a summary of formula errors (#REF!, #DIV/0!, #NAME?, #VALUE!... with sheet and cell) and of formulas Basis could not compute: fix those and call again. Styles, charts, images, data validation, defined names, comments and VBA are carried over unchanged. Pass exactly one of path, url or base64. The workbook is uploaded to the Basis API for the recalculation and not kept. Pass output_path to save the result on this machine (the same path as the input, with overwrite: true, recalculates a file in place).
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| url | No | Public https URL to fetch the .xlsx file from (private and local addresses are refused) | |
| path | No | Local filesystem path to an .xlsx file | |
| base64 | No | Base64-encoded .xlsx file bytes | |
| filename | No | Name for the returned file (defaults to workbook.xlsx) | |
| overwrite | No | Allow output_path to replace an existing file (default false: an existing file is an error) | |
| output_path | No | Write the .xlsx to this local path instead of returning it as base64 (recommended: a workbook as base64 is very large). The result then carries saved_to rather than file_base64. |