GroupDocs.Comparison for Python 26.5.0 is now available. This is the first public‑PyPI release of the library since 25.12 and introduces a pure‑Python wrapper, bundled AGENTS.md for AI‑assistant discovery, a new console script, and extensive documentation restructuring.
What’s new in this release
| Key | Category | Summary |
|---|---|---|
| COMPARISONPYTHON-34 | Feature | Pure-Python wrapper rebuild — public API is now fully introspectable from Python |
| COMPARISONPYTHON-35 | Feature | Ship AGENTS.md inside the wheel for AI-agent discovery |
| COMPARISONPYTHON-36 | Feature | New documentation page: Agents and LLM Integration (MCP server, bundled AGENTS.md, LLM‑optimized docs) |
| COMPARISONPYTHON-39 | Feature | Console script groupdocs-comparison installed with the wheel — compare, info, list-formats subcommands |
| COMPARISONPYTHON-38 | Enhancement | Documentation restructure — developer-guide/comparing-documents/ consolidates comparison-basic/ and advanced-usage/comparison/; loading and saving flattened |
Public API changes
The 26.x wrapper was rebuilt with a new generator that exposes a broader public API and cleans up a few member names. Most existing scripts written against 25.12 run unchanged on 26.5; the changes below are grouped by compatibility impact.
Newly-visible top-level classes
These classes existed in 25.12 internals but were hidden from Python introspection by the Nuitka‑compiled wrapper. They are now directly importable:
from groupdocs.comparison.license import License, Metered
from groupdocs.comparison.options import (
Color, PdfCompareOptions, WordCompareOptions, CalculateCoordinatesModeEnumeration,
ChangeType, ComparisonDisplayMode, DetalisationLevel, FolderComparisonExtension,
ImagesInheritance, MetadataType, PagesSetup, PaperSize, PasswordSaveOption,
PreviewFormats, PreviewResolution,
)
from groupdocs.comparison.result import ComparisonAction, FileType, Rectangle
New Color class
StyleSettings.font_color, .highlight_color, .shape_color, and .boarder_color now accept any of:
from groupdocs.comparison.options import Color
# Named‑color factory
style.font_color = Color.from_name("firebrick")
# RGB / RGBA tuple
style.font_color = (255, 0, 0)
style.font_color = (255, 0, 0, 128)
# Hex string
style.font_color = "#FF8800"
style.font_color = "#80FF8800" # AARRGGBB
# Packed ARGB int
style.font_color = 0xFF0000
# Or a Color instance directly
style.font_color = Color(178, 34, 34, 255)
Color is importable from groupdocs.comparison, groupdocs.comparison.options, and groupdocs.pydrawing—all three paths resolve to the same class.
Callable‑based PreviewOptions
PreviewOptions constructor accepts a Python callable for the CreatePageStream delegate. The callback signature is (page_number) -> writable_stream:
from groupdocs.comparison.options import PreviewOptions, PreviewFormats
def create_page_stream(page_number):
return open(f"page-{page_number}.png", "wb")
def release_page_stream(page_number):
pass # the bridge has already flushed/closed the stream
with Comparer("source.docx") as comparer:
preview = PreviewOptions(create_page_stream, release_page_stream)
preview.preview_format = PreviewFormats.PNG
preview.page_numbers = [1, 2, 3]
comparer.source.generate_preview(preview)
PreviewOptions(create_page_stream) (single‑arg, no release callback) is also valid.
Typed Rectangle from coordinate properties
options = CompareOptions(calculate_coordinates=True)
with Comparer("source.docx") as comparer:
comparer.add("target.docx")
comparer.compare(options)
for change in comparer.get_changes():
b = change.box
print(f"({b.x:.1f}, {b.y:.1f}) {b.width:.1f}x{b.height:.1f}")
# (488.96, 223.86) 71.09x36.80 — '…'
The fix is product‑wide—applies to every value‑typed property across every product (Point, Size, etc., not just Rectangle).
Property‑name kwargs on options constructors
opts = ApplyChangeOptions(changes=changes, save_original_state=True)
save = SaveOptions(password="secret")
load = LoadOptions(password="open-sesame")
comp = CompareOptions(detect_style_changes=True, sensitivity_of_comparison=85)
The setter pattern still works (opts = ApplyChangeOptions(); opts.changes = changes). Unknown kwargs raise TypeError.
New overload‑suffixed methods
A set of overload‑suffixed methods has been added to the public surface so each .NET overload is callable from Python by an explicit, non‑ambiguous name. Examples:
Comparer.add_file(path),add_stream(stream),add_streams(streams),add_string(text)Comparer.apply_changes_file(path, options),apply_changes_stream(stream, options), …Comparer.compare_file(...),compare_stream(...),compare_streams(...),compare_string(...),compare_compare_options(...),compare_save_options(...)Comparer.compare_directory_file(...),compare_directory_string(...)Comparer.get_changes_change_type(...),get_changes_get_change_options(...)License.set_license_file(...),set_license_stream(...),set_license_streams(...),set_license_string(...)Metered.set_metered_key_file(...),set_metered_key_string(...)Document.generate_preview_preview_options(...)localization.SupportedLocales.is_locale_supported_culture_info(...),is_locale_supported_file(...),is_locale_supported_string(...)
Explicit Comparer.dispose()
Available for callers who prefer not to use the with context‑manager idiom. The recommended pattern remains:
with Comparer("source.docx") as comparer:
comparer.add("target.docx")
comparer.compare("result.docx")
Enum casing
All enums use UPPERCASE Python convention. Common enums:
from groupdocs.comparison.result import ComparisonAction, FileType
from groupdocs.comparison.options import (
ChangeType, ComparisonDisplayMode, DetalisationLevel,
FolderComparisonExtension, ImagesInheritance, MetadataType,
PaperSize, PasswordSaveOption, PreviewFormats, PreviewResolution,
)
from groupdocs.comparison.words.revision import RevisionAction
ComparisonAction.ACCEPT, ComparisonAction.REJECT, ComparisonAction.NONE
RevisionAction.ACCEPT, RevisionAction.REJECT, RevisionAction.NONE
PreviewFormats.PNG, PreviewFormats.JPG
MetadataType.SOURCE, MetadataType.TARGET, MetadataType.FILE_AUTHOR
PasswordSaveOption.USER, PasswordSaveOption.SOURCE, PasswordSaveOption.TARGET
If you were on 25.12 documentation that showed .Accept/.Reject style values, update them to the uppercase form.
Code example
Below is a minimal example that demonstrates importing the newly visible top‑level classes and performing a simple comparison:
from groupdocs.comparison import Comparer
from groupdocs.comparison.options import CompareOptions
options = CompareOptions(detect_style_changes=True)
with Comparer("source.docx") as comparer:
comparer.add("target.docx")
comparer.compare(options)
for change in comparer.get_changes():
print(f"Change type: {change.change_type}, Box: {change.box}")
How to get the update
PyPI
pip install groupdocs-comparison-net==26.5.0
The wheel is published on public PyPI: https://pypi.org/project/groupdocs-comparison-net/
Direct download
No direct download links are provided; obtain the package via PyPI or the GroupDocs website.
Resources
- PyPI project page: https://pypi.org/project/groupdocs-comparison-net/
- Agents and LLM Integration documentation: https://docs.groupdocs.com/comparison/python-net/agents-and-llm-integration/
- Examples repository: https://github.com/groupdocs-comparison/GroupDocs.Comparison-for-Python-via-.NET
- Issue reporting forum: https://forum.groupdocs.com/c/comparison/
- Paid Support Helpdesk: https://helpdesk.groupdocs.com/