docx-compare is a Python script designed to facilitate the comparison of two Microsoft Word documents in a quick and straightforward manner. Leveraging the power of the python-docx
library for parsing Word documents and Git's git-diff
utility for comparison, this tool provides a simple yet effective means of identifying differences between two .docx files.
- Easy Comparison: Quickly compare two Microsoft Word documents.
- Detailed Diffing: Identify differences at a granular level, including text changes, additions, and deletions.
- Git Integration: Utilizes Git's
git-diff
for robust document comparison. - Pythonic: Written in Python, making it easily extensible and modifiable.
- Simple Usage: Minimal setup and intuitive command-line interface.
Before using docx-compare, ensure you have the following installed:
- Python 3.x
python-docx
library- Git (for
git-diff
)
-
Clone the repository:
git clone https://github.com/your-username/docx-compare.git
-
Install the required dependencies:
pip install -r requirements.txt
To compare two Word documents, use the following command:
python compare.py path/to/document1.docx path/to/document2.docx
This command will output a diff folder that contains the textual content of the two documents and two command files that will launch the comparison:
# Windows
diff/compare.bat
# Linux or Mac
. diff/compare.sh
python compare.py document_old.docx document_new.docx
diff/compare.bat
Output:
Made with ❤️ by Ignema