Skip to main content

xlcompare

Compare two Excel files (old vs new) where each row has a unique ID (identifier). Ideal for comparing requirements, bill of materials, invoices, exported databases, etc. Generates differences Excel file showing changes from old to new (red strikeout for deletions, blue for insertions). Supports both .xls and .xlsx formats as inputs.

Easy To Use

Generate differences Excel file diff.xlsx with:

xlcompare old.xls new.xls

Features

  • Supports both .xls and .xlsx file formats for input files
  • Generates output Excel file containing differences (default: diff.xlsx)
  • Output is autofiltered to show differences at a glance
  • Changes in each cell are marked with red strikeout for deletions, blue for insertions
  • Deleted rows will be at the bottom in red strikeout
  • Pure Python (uses xlrd, pylightxl, XlsxWriter packages)

Excel File Format Assumptions

  • First row is assumed to contain column headings
  • Columns that are common between the two files will be compared (others are ignored)
  • Column containing unique IDs is labeled "ID" (can override with the --id option)

Limitations:

  • Only compares first sheet of each Excel file
  • Compares cells as text
  • Python 3.6 or later

Installation

python -m pip install xlcompare

Usage

usage: xlcompare [-h] [--id ID] [--outfile OUTFILE] [--colwidthmax COLWIDTHMAX] oldfile newfile

Compares Excel .xls or .xlsx files (first sheet only) with headers and unique row IDs; generates diff.xlsx.

positional arguments:
  oldfile               old Excel file
  newfile               new Excel file

optional arguments:
  -h, --help            show this help message and exit
  --id ID               ID column heading (default: ID)
  --outfile OUTFILE, -o OUTFILE
                        output .xlsx file of differences (default: diff.xlsx)
  --colwidthmax COLWIDTHMAX
                        maximum column width in output file (default: 50)

Examples

xlcompare old.xls new.xls   # Generates diff.xlsx
xlcompare old.xls new.xlsx  # Generates diff.xlsx
xlcompare old.xlsx new.xls  # Generates diff.xlsx
xlcompare old.xls new.xls -o mydiff.xlsx # Generates mydiff.xlsx
xlcompare old.xlsx new.xls --id MYID     # Uses "MYID" as the ID column

Metadata

Release files for xlcompare 0.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 xlcompare 0.2.0
File Size Uploaded
xlcompare-0.2.0.tar.gz 8.2 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for xlcompare 0.2.0
File Interpreter ABI Platform
xlcompare-0.2.0-py3-none-any.whl Python 3 none any Details

Total release size: 16.0 kB

Release files / xlcompare-0.2.0.tar.gz

Download URL xlcompare-0.2.0.tar.gz
Size 8.2 kB
Tags Source
SHA-256 checksum
How to use checksums
058fdc7d9c8052f2d7ca1f058e4387ea4f0c773bb5ba0dd8ea7c84d96b8d1a1a
BLAKE2b-256 checksum
How to use checksums
4fef16ea32383dee2e8c64b8be84972813b525bbc999d5488c91b8aff3eed803
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.4.1 importlib_metadata/4.0.1 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.9.1

Release files / xlcompare-0.2.0-py3-none-any.whl

Download URL xlcompare-0.2.0-py3-none-any.whl
Size 7.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
36bcc56a9c8c1e3ef3f1a9fd1c672d85b33db87a22c1a416e4b75ac664b81171
BLAKE2b-256 checksum
How to use checksums
d2450b60cbcc8c75f40396e9016ca5de72cdccbd2e310813f6dc5c97128ab62f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.4.1 importlib_metadata/4.0.1 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.9.1

Release history Release notifications | RSS feed

This release

0.2.0 This release

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