Skip to main content

xlsx-fixer

A zero-dependency delivery-assurance layer for Python data pipelines.

Stop delivering "corrupted" Excel files to your clients and executives.

PyPI Version Python Versions License


🚨 The 17-Year-Old Bug

If you generate .xlsx files with Python's openpyxl library and open them on a Mac, your stakeholders will see this terrifying warning:

⚠️ "We found a problem with some content in 'report.xlsx'. Do you want us to try to recover as much as we can?"

For a solo developer, this is annoying. For a data engineering team delivering automated reporting to C-suite executives or high-value clients, this completely destroys the professional credibility of the automation pipeline.

Why does this happen?

openpyxl hardcodes inline strings (t="inlineStr") for every text cell. Mac Excel's strict OOXML parser rejects this. The openpyxl maintainer has declined to fix this for 17+ years, calling it a permanent design decision.

How we fix it

xlsx-fixer intercepts the generated file, safely rebuilds the XML to use a proper shared string table (xl/sharedStrings.xml), drops inconsistent calculation states, and strips illegal control characters. One function call. Zero dependencies.


🛠️ The Open Source Tier (Free)

This repository contains the core fix() engine. It is perfect for ad-hoc scripts and individual files.

pip install xlsx-fixer

Usage (Python)

from openpyxl import Workbook
from xlsx_fixer import fix

wb = Workbook()
ws = wb.active
ws["A1"] = "Hello, Mac Excel!"

# 1. Save normally
wb.save("report.xlsx")

# 2. Fix it before sending to the client
fix("report.xlsx") 

Usage (CLI)

# Fix a single file in-place
xlsx-fixer fix report.xlsx

# Check a file for corruption patterns without modifying
xlsx-fixer check report.xlsx

🚀 The Enterprise Tier (xlsx-fixer Pro)

For data engineering teams and CI/CD pipelines, we offer xlsx-fixer Pro.

If you are running Airflow, GitHub Actions, or processing hundreds of files, the Open Source version is too slow and requires too much manual code modification. xlsx-fixer Pro is a pre-compiled, un-hackable binary (Linux/Mac/Windows) designed for enterprise scale.

Feature xlsx-fixer (Free) xlsx-fixer Pro
Single File Fix (fix())
Drop-in Patch (patch_openpyxl())
Multithreaded Batch CLI (batch)
Big Data Safe Mode (OOM prevention)
CI Audit Reporting (--report json)
Deployment Format Source Code Compiled Native Binary

⚡ The Drop-In Patch

Don't rewrite 100 legacy scripts. Just call patch_openpyxl() once at the top of your application, and every wb.save() call is automatically fixed in-place before it hits the disk.

💼 Commercial Licenses

License Target Audience Link
Pipeline License ($299/yr) Solo Automators / Boutique Agencies Purchase on Lemon Squeezy
Site License ($899/yr) Enterprise Data Teams (Uncapped) Purchase on Lemon Squeezy

Upon purchase, you will immediately receive your License Key and a secure download link for the compiled CI binaries.


🔬 What It Fixes Under The Hood

# Issue Root Cause Impact
1 Inline strings openpyxl hardcodes t="inlineStr" "We found a problem" dialog on every Mac open
2 fullCalcOnLoad openpyxl sets fullCalcOnLoad="1" without generating calcChain.xml Recovery dialog; formulas show 0
3 Stale calcChain.xml References cells that no longer contain formulas "Removed Records: Formula" in repair log
4 Control characters Illegal XML 1.0 chars (U+0000-U+0008, etc.) in cell values ST_Xstring validation failures

License

The free xlsx-fixer engine is licensed under the MIT License. See LICENSE for details.

Release files for xlsx-fixer 1.2.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for xlsx-fixer 1.2.0
File Size Uploaded
xlsx_fixer-1.2.0.tar.gz 12.1 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for xlsx-fixer 1.2.0
File Interpreter ABI Platform
xlsx_fixer-1.2.0-py3-none-any.whl Python 3 none any Details

Total release size: 23.3 kB

Release files / xlsx_fixer-1.2.0.tar.gz

Download URL xlsx_fixer-1.2.0.tar.gz
Size 12.1 kB
Tags Source
SHA-256 checksum
How to use checksums
b4754a8e67a9f0d1df6479216926755b6563b233035f7f36887783f93aa27fb7
BLAKE2b-256 checksum
How to use checksums
51da7be0fc15eafddf3ff056bcc9fc3f58a6b3477c3f52e648925108ab6e7a01
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.14.3

Release files / xlsx_fixer-1.2.0-py3-none-any.whl

Download URL xlsx_fixer-1.2.0-py3-none-any.whl
Size 11.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
7bae15568969af8530013750412ca647c2810243f83e54bd165c9450021005b7
BLAKE2b-256 checksum
How to use checksums
7040c68a4edd7ff44b4631d3ea8c064b05ec8977a475e6b43973a58f87d9ed9e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.14.3

Release history Release notifications | RSS feed

This release

1.2.0 This release

2 release files

1.1.0

2 release files

1.0.0

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page