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.2.tar.gz (7.3 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.2-py3-none-any.whl (8.3 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: xlsx_formula_compiler-0.1.2.tar.gz
  • Upload date:
  • Size: 7.3 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.2.tar.gz
Algorithm Hash digest
SHA256 b5fd98ff35e95fa4dabe9ff8e3c79de0cd4db6e486a16659dcdd225bd8dc9d0b
MD5 13333135920ee4603697cd0db3504a1c
BLAKE2b-256 6b10f50c05ba259db21dc123d93feabebc2a3ab8a272809b2b0d88e714c8d73c

See more details on using hashes here.

File details

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

File metadata

  • Download URL: xlsx_formula_compiler-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 8.3 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.2-py3-none-any.whl
Algorithm Hash digest
SHA256 8f2cf69aa4b1e9e9d19a47b19ef507f338ec2d64786e50d880b895e29fe40eaa
MD5 039256f88957f10c9010918396167ce6
BLAKE2b-256 91e5eb7070623861080b79d606fdb923f71c3e72e5a4b1851700371e6200c8ed

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