Skip to main content

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 in pyproject.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


Download files

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

Source Distribution

compareexcel-0.2.1.tar.gz (5.7 kB view details)

Uploaded Source

Built Distribution

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

compareexcel-0.2.1-py3-none-any.whl (6.6 kB view details)

Uploaded Python 3

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

Hashes for compareexcel-0.2.1.tar.gz
Algorithm Hash digest
SHA256 be0c3d7ab8dd8454280b9e2f4f2f9a89ac07f949cf71fa69ff03aba4105729c2
MD5 8733ce006c8aa4b56cd8d63dd133f8ec
BLAKE2b-256 c688d879fcc80b8ba5acaaccd82deea9e2ac5a39cba1ead514c5ef23a6bfb778

See more details on using hashes here.

Provenance

The following attestation bundles were made for compareexcel-0.2.1.tar.gz:

Publisher: python-publish.yml on abhidotnet/compareexcel

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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

Hashes for compareexcel-0.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 be70a03af9927b5671202b409fb5bd027c626c65dd8cd8def2717edcf57cd63f
MD5 e9a7e996b120f5de8df14ef0be52787d
BLAKE2b-256 c250df1a9db8f05bc143d0338d808467edaa9cb4f546655203c25fd298c6827d

See more details on using hashes here.

Provenance

The following attestation bundles were made for compareexcel-0.2.1-py3-none-any.whl:

Publisher: python-publish.yml on abhidotnet/compareexcel

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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