Browse our Products

If so you can download any of the below versions for testing. The product will function as normal except for an evaluation limitation. At the time of purchase we provide a license file via email that will allow the product to work in its full capacity. If you would also like an evaluation license to test without any restrictions for 30 days, please follow the directions provided here.


Product Docs Swagger Examples Blog Support Dashboard

Installation

The package is available at PyPI and it can be installed via pip by executing following command:

pip install groupdocs-comparison-cloud

PyPI - Version PyPI - Downloads Python-GroupDocsCloud


Requirements

Dependencies

The SDK automatically installs the following packages:

PackageConstraint
urllib3>= 1.15
six>= 1.10
certifi
python-dateutil

Document Comparison & Revision Python Cloud REST API

GroupDocs.Comparison Cloud SDK for Python is a powerful cloud REST API designed for developers to integrate document comparison functionality into Python web apps, scripts, and automation workflows. Supporting over 90 file formats, this API allows you to compare entire folders, accept or reject document revisions, and visualize changes with page previews. With features like granular change control, style customization, and multi-document support, developers can efficiently automate bulk file comparisons. Additional features include password-protected document comparison, source code file merging, and extraction of detailed change coordinates. This tool is ideal for collaborative environments, legal document review, and version control systems.

Folder and Document Comparison

Compare entire folders - Compare the contents of entire directories with automatic detection of differences.
Filter changed items - Save results in TXT or HTML formats and display only changed items.
Bulk file comparison - Automate bulk file comparisons efficiently within Python applications.

Document Revision Control

Accept or reject revisions in DOCX - Programmatically accept or reject revisions in Word DOCX files.
Extract revision list - Retrieve all revisions, apply desired changes, and reject others.
Version management - Enable complete control over document editing and version management.

Document Page Preview Generation

Generate page previews - Create high-quality preview images before saving comparison results.
Custom preview formats - Specify formats (PNG, JPG, BMP) and select custom dimensions.
Visual review workflows - Integrate document previews into applications requiring visual content management.

Change Management and Review

Accept or reject detected changes - Control document changes with granular precision.
Show revisions and track changes - Highlight differences using Word-style track changes.
Set author of changes - Assign authorship to detected changes for enhanced accountability.

Customization and Flexibility

Customize change styles - Control fonts, colors, and text styles (bold, italic, strikethrough).
Adjust comparison sensitivity - Balance speed and accuracy with sensitivity settings from 0 to 100.

Multi-Document Support

Compare multiple documents - Compare more than two documents simultaneously.
Password-protected documents - Compare password-protected source and target files.
Merge source code files - Compare and merge multiple versions of source code files with change control.

Detailed Change Analysis

Get changes coordinates - Retrieve the exact location of changes within documents.
Get list of changes - Receive a detailed list including change type, page number, and affected text.
Extract source and target text - Extract original and modified text for each detected change.

Saving and Metadata Control

Set document metadata on save - Control author, title, or organization on output documents.
Set password for output document - Apply password protection to resulting documents.

Licensing and Authentication

Evaluation Mode - Try the API with a free trial account.
Secure Authentication - Use Client ID and Client Secret for secure API access.
MIT License - The Python SDK is licensed under the MIT License.

Supported Document Formats

GroupDocs.Comparison Cloud supports 90+ file formats with comparison and auto-detection capabilities:

  • Word Processing: DOC, DOCM, DOCX, DOT, DOTM, DOTX, ODT, OTT, RTF
  • Spreadsheets: XLS, XLT, XLSX, XLTM, XLSB, XLSM, ODS, CSV
  • Presentations: POT, POTX, PPS, PPSX, PPTX, PPT, ODP, OTP
  • Diagrams: VSDX, VSD, VSS, VST, VDX
  • Notes: ONE (Microsoft OneNote)
  • PDF and Page Layout: PDF, MOBI, DJVU
  • Images: BMP, GIF, JPG/JPEG, PNG, DCM, DWG, DXF
  • Email: EML, EMLX, MSG
  • Web: HTML, MHT, MHTML
  • Source Code: CS, JAVA, CPP, JS, PY, RB

Supported operations vary by format. For the complete format matrix, see the documentation.

Quick Start

Get your API credentials

To use GroupDocs.Comparison Cloud, sign up at GroupDocs.Cloud Dashboard and get your Client ID and Client Secret.

Initialize the API

Use the following code to start using the GroupDocs.Comparison Cloud SDK for Python:

import groupdocs_comparison_cloud

# Get your ClientId and ClientSecret at https://dashboard.groupdocs.cloud
client_id = "YourClientId"
client_secret = "YourClientSecret"

# Create API configuration
configuration = groupdocs_comparison_cloud.Configuration(client_id, client_secret)
configuration.api_base_url = "https://api.groupdocs.cloud"

# Create instance of the Compare API
compare_api = groupdocs_comparison_cloud.CompareApi.from_config(configuration)

Compare two documents

Once initialized, use this basic example to compare Word documents and save the result:

import groupdocs_comparison_cloud

compare_api = groupdocs_comparison_cloud.CompareApi.from_keys("YourClientId", "YourClientSecret")

source = groupdocs_comparison_cloud.FileInfo()
source.file_path = "source_files/word/source.docx"
target = groupdocs_comparison_cloud.FileInfo()
target.file_path = "target_files/word/target.docx"
options = groupdocs_comparison_cloud.ComparisonOptions()
options.source_file = source
options.target_files = [target]
options.output_path = "output/result.docx"

response = compare_api.comparisons(groupdocs_comparison_cloud.ComparisonsRequest(options))

print("Output file link: " + response.href)

With this quick start guide, you’re all set to begin comparing documents using GroupDocs.Comparison Cloud in your Python applications. For more details, visit the documentation.

Get Supported File Formats

Retrieve the full list of supported file formats available through the Comparison API.

import groupdocs_comparison_cloud

info_api = groupdocs_comparison_cloud.InfoApi.from_keys("YourClientId", "YourClientSecret")

result = info_api.get_supported_file_formats()

print("Formats count: " + str(len(result.formats)))

Compare PDF Documents

Compare two PDF documents and save the result with tracked changes highlighted.

import groupdocs_comparison_cloud

compare_api = groupdocs_comparison_cloud.CompareApi.from_keys("YourClientId", "YourClientSecret")

source = groupdocs_comparison_cloud.FileInfo()
source.file_path = "source_files/pdf/source.pdf"
target = groupdocs_comparison_cloud.FileInfo()
target.file_path = "target_files/pdf/target.pdf"
options = groupdocs_comparison_cloud.ComparisonOptions()
options.source_file = source
options.target_files = [target]
options.output_path = "output/result.pdf"

response = compare_api.comparisons(groupdocs_comparison_cloud.ComparisonsRequest(options))

print("Output file link: " + response.href)

Compare Password-Protected Documents

Compare two password-protected Word documents by supplying credentials for each file.

import groupdocs_comparison_cloud

compare_api = groupdocs_comparison_cloud.CompareApi.from_keys("YourClientId", "YourClientSecret")

source = groupdocs_comparison_cloud.FileInfo()
source.file_path = "source_files/word/source_protected.docx"
source.password = "1231"
target = groupdocs_comparison_cloud.FileInfo()
target.file_path = "target_files/word/target_protected.docx"
target.password = "5784"
options = groupdocs_comparison_cloud.ComparisonOptions()
options.source_file = source
options.target_files = [target]
options.output_path = "output/result.docx"

response = compare_api.comparisons(groupdocs_comparison_cloud.ComparisonsRequest(options))

print("Output file link: " + response.href)

Get List of Changes

Retrieve a detailed list of all changes detected between source and target documents.

import groupdocs_comparison_cloud

compare_api = groupdocs_comparison_cloud.CompareApi.from_keys("YourClientId", "YourClientSecret")

source = groupdocs_comparison_cloud.FileInfo()
source.file_path = "source_files/word/source.docx"
target = groupdocs_comparison_cloud.FileInfo()
target.file_path = "target_files/word/target.docx"
options = groupdocs_comparison_cloud.ComparisonOptions()
options.source_file = source
options.target_files = [target]
options.output_path = "output/result.docx"

changes = compare_api.post_changes(groupdocs_comparison_cloud.PostChangesRequest(options))

print("Changes count: " + str(len(changes)))

Accept or Reject Changes

Accept or reject individual changes after comparing documents and save the updated result.

import groupdocs_comparison_cloud

compare_api = groupdocs_comparison_cloud.CompareApi.from_keys("YourClientId", "YourClientSecret")

source = groupdocs_comparison_cloud.FileInfo()
source.file_path = "source_files/word/source.docx"
target = groupdocs_comparison_cloud.FileInfo()
target.file_path = "target_files/word/target.docx"
options = groupdocs_comparison_cloud.UpdatesOptions()
options.source_file = source
options.target_files = [target]
options.output_path = "output/result.docx"

changes = compare_api.post_changes(groupdocs_comparison_cloud.PostChangesRequest(options))

for change in changes:
    change.comparison_action = "Reject"
changes[0].comparison_action = "Accept"

options.changes = changes

response = compare_api.put_changes_document(groupdocs_comparison_cloud.PutChangesDocumentRequest(options))

print("Output file link: " + response.href)

Compare Multiple Documents with Options

Compare a source document against multiple targets and customize the appearance of inserted items.

import groupdocs_comparison_cloud

compare_api = groupdocs_comparison_cloud.CompareApi.from_keys("YourClientId", "YourClientSecret")

source = groupdocs_comparison_cloud.FileInfo()
source.file_path = "source_files/word/source.docx"
target = groupdocs_comparison_cloud.FileInfo()
target.file_path = "target_files/word/target.docx"
target1 = groupdocs_comparison_cloud.FileInfo()
target1.file_path = "target_files/word/target_1.docx"
target2 = groupdocs_comparison_cloud.FileInfo()
target2.file_path = "target_files/word/target_2.docx"
options = groupdocs_comparison_cloud.ComparisonOptions()
options.source_file = source
options.target_files = [target, target1, target2]
options.output_path = "output/result.docx"
settings = groupdocs_comparison_cloud.Settings()
settings.inserted_items_style = groupdocs_comparison_cloud.ItemsStyle()
settings.inserted_items_style.font_color = "16711680"
options.settings = settings

response = compare_api.comparisons(groupdocs_comparison_cloud.ComparisonsRequest(options))

print("Output file link: " + response.href)

Apply Revisions in DOCX Documents

Accept or reject tracked revisions in a Word document programmatically.

import groupdocs_comparison_cloud

review_api = groupdocs_comparison_cloud.ReviewApi.from_keys("YourClientId", "YourClientSecret")

source = groupdocs_comparison_cloud.FileInfo()
source.file_path = "source_files/word/source_with_revs.docx"
options = groupdocs_comparison_cloud.ApplyRevisionsOptions()
options.source_file = source
options.output_path = "output/result.docx"

revisions = review_api.get_revisions(groupdocs_comparison_cloud.GetRevisionsRequest(source))

for revision in revisions:
    revision.action = "Accept"

options.revisions = revisions

response = review_api.apply_revisions(groupdocs_comparison_cloud.ApplyRevisionsRequest(options))

print("Output file link: " + response.href)

Sample Projects on GitHub

The GroupDocs.Comparison Cloud Python Samples repository includes ready-to-run examples covering:

CategoryExamples
BasicUsageSupported formats, document information, compare documents, compare PDF documents, preview document
AdvancedUsage — CompareMultipleDocumentsCompare multiple documents with options, compare multiple protected documents
AdvancedUsage — RevisionsGet list of revisions, apply revisions, accept all revisions, reject all revisions
AdvancedUsage — SaveOptionsSet metadata, set password on save
AdvancedUsage — Change ControlAccept or reject changes, compare protected documents, compare sensitivity, customize change styles, get changes coordinates, get list of changes

How to run the examples

  1. Clone or download the samples repository
  2. Edit Examples/RunExamples.py and set your client_id and client_secret
  3. Go to the Examples directory
  4. Run pip install groupdocs-comparison-cloud -U
  5. Execute python RunExamples.py

For more details, visit Getting Started.


Product Docs Swagger Examples Blog Support Dashboard


Tags

Document Comparison API | Python Cloud API | GroupDocs.Comparison Cloud | REST API | Document Comparison | Folder Comparison | Revision Control | Track Changes | Preview Generation | Multi-format Support | Password Protected Documents | Source Code Comparison | Change Tracking | Customization | Document Merging | Change Coordinates | Metadata Extraction | Document Security | Document Review | Secure API Access | Cloud Storage Integration | Cross-platform API



 English