--- id: merge3 version: "0.0.16" license: GPL-2.0-or-later license_treatment: copyleft maintenance: active --- # merge3 — Python implementation of 3-way merge License: copyleft · Maintenance: active · Downloads: 90.0K/mo ## What it is and what it does merge3 is a pure-Python implementation of the 3-way merge algorithm used in version control systems. It takes three text sequences—a common base and two independent modifications—and produces a merged result that incorporates both changes. When changes conflict, it marks the conflicting regions with annotated conflict markers so you can see which branch contributed which lines. The package works with sequences of lines (typically strings) rather than raw files, giving you control over how to split and process text. It can be used as a library from Python code or invoked as a command-line tool. With no external dependencies and support for modern Python versions, it's lightweight and straightforward to integrate into tools that need to resolve text merges programmatically. Use it for: - Implement merge logic in a custom version control or document collaboration tool - Resolve text conflicts when merging branches in a non-Git workflow - Build a three-way diff viewer that shows how changes from two sources combine - Automate merging of configuration or data files from multiple sources - Test merge behavior in applications that handle concurrent text edits ## Worth the install? AI-flagged interpretation of the facts above — verify before relying. Implements 3-way merge of text sequences, combining changes from two independent branches against a common base to produce a merged result with conflict markers. Yes, if you need 3-way merge logic and accept the GPL-2.0-or-later copyleft constraint. The package is actively maintained, has no dependencies, and works across modern Python versions. It's a solid choice for tools that must resolve text conflicts programmatically. No if your project cannot adopt copyleft licensing. ## Install pip install merge3 uv add merge3 poetry add merge3 ## Installing merge3 Before you install: Low friction: pure Python wheel with no runtime dependencies. Actively maintained with recent commits and broad Python version support from 3.9 through 3.14. License in practice: GPL-2.0-or-later copyleft license: any derivative work or distribution must be released under compatible terms. Review your project's licensing model before integrating. Quickstart: import merge3 m3 = merge3.Merge3( ['common\n', 'base\n'], ['common\n', 'a\n'], ['common\n', 'b\n'] ) result = list(m3.merge_annotated()) Requires Python 3.9 or later. Verify before relying: - Whether conflict markers are customizable or follow a fixed format - Performance characteristics on large text sequences or files - Whether the package handles binary data or is text-only ## Package facts - License: GPL-2.0-or-later (copyleft) - Python support: supports_current - Install friction: low - Maintenance: active - Downloads: 90.0K/month (top 15,000 on PyPI) - Known vulnerabilities: none known ## Tags 3-way merge text, merge conflict resolution, diff merge algorithm, text merge base other this, line-based merge, merge annotated output, version control merge, merge-algorithm, version-control, conflict-resolution [View on SkillFed](https://skillfed.io/packages/merge3) · [View on PyPI](https://pypi.org/project/merge3/)