Compare two Excel workbooks for column number formats and cell alignment differences, with optional Excel report output.
Project description
Excel Compare (compareExcel)
compareExcel is a small command-line tool and Python library that compares two Excel (.xlsx) workbooks. It reports differences in column number formats, data cell alignment (sampled from non-empty cells), and header row alignment for columns that exist in both files.
Install from PyPI with pip install compareexcel. The distribution and import package name is compareexcel. Installed console scripts are compareexcel and compareExcel (same entry point).
Requirements
- Python 3.10+
- Dependencies:
pandas,openpyxl(declared inpyproject.toml)
Installation
From the repository root (compareexcel/):
pip install .
Editable install while developing:
pip install -e .
Command-line usage
compareExcel FILE1 FILE2 [--sheet SHEET_NAME] [--output REPORT.xlsx] [--alignment-only]
| Argument / option | Description |
|---|---|
FILE1, FILE2 |
Paths to the two Excel files to compare. |
--sheet |
Compare only this sheet; default is all sheets that exist in both workbooks. |
--output |
Write a multi-sheet Excel report (Formatting_Diffs, Data_Alignment_Diffs, Header_Alignment_Diffs). |
--alignment-only / --ao |
Reserved for future use (currently parsed only). |
Example:
compareExcel workbook_a.xlsx workbook_b.xlsx --output diff_report.xlsx
A short summary is always printed to the console; use --output to persist detailed rows to an .xlsx file.
Library usage
from openpyxl import load_workbook
from compareexcel import (
compare_formatting,
compare_data_alignment,
compare_header_alignment,
write_report,
)
wb1 = load_workbook("a.xlsx")
wb2 = load_workbook("b.xlsx")
sheet = wb1.sheetnames[0]
fmt = compare_formatting(wb1[sheet], wb2[sheet])
data_align = compare_data_alignment(wb1[sheet], wb2[sheet])
header_align = compare_header_alignment(wb1[sheet], wb2[sheet])
write_report("out.xlsx", fmt, data_align, header_align)
Package layout
compareexcel/
├── src/
│ └── compareexcel/
│ ├── __init__.py # Public API and version
│ ├── cli.py # Entry point and argument parsing
│ ├── core.py # Comparison logic
│ └── report.py # Excel report writer
├── pyproject.toml
├── README.md
├── LICENSE
└── .gitignore
License
See LICENSE.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file compareexcel-0.2.1.tar.gz.
File metadata
- Download URL: compareexcel-0.2.1.tar.gz
- Upload date:
- Size: 5.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
be0c3d7ab8dd8454280b9e2f4f2f9a89ac07f949cf71fa69ff03aba4105729c2
|
|
| MD5 |
8733ce006c8aa4b56cd8d63dd133f8ec
|
|
| BLAKE2b-256 |
c688d879fcc80b8ba5acaaccd82deea9e2ac5a39cba1ead514c5ef23a6bfb778
|
Provenance
The following attestation bundles were made for compareexcel-0.2.1.tar.gz:
Publisher:
python-publish.yml on abhidotnet/compareexcel
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
compareexcel-0.2.1.tar.gz -
Subject digest:
be0c3d7ab8dd8454280b9e2f4f2f9a89ac07f949cf71fa69ff03aba4105729c2 - Sigstore transparency entry: 1461323000
- Sigstore integration time:
-
Permalink:
abhidotnet/compareexcel@28dd5826bb6172718cc3da1ad55b7b4cb49b598b -
Branch / Tag:
refs/tags/0.2.1 - Owner: https://github.com/abhidotnet
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-publish.yml@28dd5826bb6172718cc3da1ad55b7b4cb49b598b -
Trigger Event:
release
-
Statement type:
File details
Details for the file compareexcel-0.2.1-py3-none-any.whl.
File metadata
- Download URL: compareexcel-0.2.1-py3-none-any.whl
- Upload date:
- Size: 6.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
be70a03af9927b5671202b409fb5bd027c626c65dd8cd8def2717edcf57cd63f
|
|
| MD5 |
e9a7e996b120f5de8df14ef0be52787d
|
|
| BLAKE2b-256 |
c250df1a9db8f05bc143d0338d808467edaa9cb4f546655203c25fd298c6827d
|
Provenance
The following attestation bundles were made for compareexcel-0.2.1-py3-none-any.whl:
Publisher:
python-publish.yml on abhidotnet/compareexcel
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
compareexcel-0.2.1-py3-none-any.whl -
Subject digest:
be70a03af9927b5671202b409fb5bd027c626c65dd8cd8def2717edcf57cd63f - Sigstore transparency entry: 1461323062
- Sigstore integration time:
-
Permalink:
abhidotnet/compareexcel@28dd5826bb6172718cc3da1ad55b7b4cb49b598b -
Branch / Tag:
refs/tags/0.2.1 - Owner: https://github.com/abhidotnet
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-publish.yml@28dd5826bb6172718cc3da1ad55b7b4cb49b598b -
Trigger Event:
release
-
Statement type: