Skip to main content

Translate modern Excel formulas into OOXML syntax (e.g., _xlfn. prefixes) to work perfectly with xlsxwriter.

Project description

xlsx_formula_compiler

Translate modern Excel formulas into OOXML-compliant syntax (e.g., adding _xlfn. prefixes) for seamless use with xlsxwriter.

Installation

uv add xlsx_formula_compiler
# or
pip install xlsx_formula_compiler

Why do I need this?

Modern Excel features like Dynamic Arrays (the # operator) or functions like XLOOKUP require specific XML prefixes (_xlfn., _xlws.) to be recognized correctly by Excel when generated via libraries like xlsxwriter.

This library automates that translation so you can write formulas as they appear in the Excel formula bar.

Quick Start

from xlsx_formula_compiler import compile_formula

# Convert a dynamic array formula
raw_formula = "=A1#"
compiled = compile_formula(raw_formula)
print(compiled) 
# Output: _xlfn.ANCHORARRAY(A1)

# Use with xlsxwriter
import xlsxwriter
workbook = xlsxwriter.Workbook('demo.xlsx')
worksheet = workbook.add_worksheet()
worksheet.write_dynamic_array_formula('B1', compiled)
workbook.close()

License

Apache License 2.0

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

xlsx_formula_compiler-0.1.3.tar.gz (7.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

xlsx_formula_compiler-0.1.3-py3-none-any.whl (8.4 kB view details)

Uploaded Python 3

File details

Details for the file xlsx_formula_compiler-0.1.3.tar.gz.

File metadata

  • Download URL: xlsx_formula_compiler-0.1.3.tar.gz
  • Upload date:
  • Size: 7.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.10.9 {"installer":{"name":"uv","version":"0.10.9","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for xlsx_formula_compiler-0.1.3.tar.gz
Algorithm Hash digest
SHA256 4e6c82096bdbde0c8885e35c743a0f547ce42cd4b3c711ac3b5c8ecffe0561fb
MD5 fe5aee61f0319058cc1b40e65070ddcf
BLAKE2b-256 c670bb6775656a9835521355c5a61575b1e2605c359f2906c1a6639d349c7360

See more details on using hashes here.

File details

Details for the file xlsx_formula_compiler-0.1.3-py3-none-any.whl.

File metadata

  • Download URL: xlsx_formula_compiler-0.1.3-py3-none-any.whl
  • Upload date:
  • Size: 8.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.10.9 {"installer":{"name":"uv","version":"0.10.9","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for xlsx_formula_compiler-0.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 4d92c6436198c272a5abe45ef2a1883f965a060908d07979d94d130f5ba4c689
MD5 12a69f34e2032c3f479a3e5dd3b6e6d9
BLAKE2b-256 73830d79651945a40f652af4b46a6d050997b509232e9b220e05fea32b734956

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page