pyclipper
Cython wrapper for the C++ translation of the Angus Johnson's Clipper library (ver. 6.4.2)
What it is and what it does
Pyclipper is a Cython wrapper around Angus Johnson's Clipper library (version 6.4.2), a C++ polygon clipping and offsetting engine. It exposes the core clipping operations—intersection, union, difference, and exclusive-or—as well as polygon offsetting, using Vatti's clipping algorithm for numerical robustness. The library works with integer coordinates internally to avoid floating-point precision issues; helper functions scale_to_clipper() and scale_from_clipper() are provided to convert between floating-point and integer representations.
The package is designed for developers working with computational geometry, graphics, or CAD-like applications. It has no runtime dependencies beyond Python itself. The API closely mirrors the original C++ library's naming conventions, with classes Pyclipper and PyclipperOffset replacing the C++ Clipper and ClipperOffset. Since version 1.0.0, automatic scaling via SCALING_FACTOR was removed to preserve the original library's numerical robustness, which is a breaking change from earlier versions.
Use it for:
- Compute intersections, unions, or differences of polygon regions in graphics or GIS applications.
- Offset polygon boundaries inward or outward by a fixed distance for buffer operations.
- Perform boolean operations on closed polygons in CAD or design software.
- Combine multiple polygon paths with clipping rules (even-odd or non-zero winding) in computational geometry.
- Scale and clip line segments or polygons while maintaining numerical precision in scientific applications.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Pyclipper performs polygon clipping operations (intersection, union, difference, exclusive-or) and polygon offsetting using a Cython wrapper around the C++ Clipper library version 6.4.2.
Yes, if you need robust polygon clipping or offsetting. The package is stable, has no known vulnerabilities, supports current Python versions (3.10–3.14), and is widely downloaded (11.7M monthly). The aging maintenance status (256 days since release) is a minor concern but not a blocker; the repository is active and the underlying algorithm is mature. Install friction is moderate due to compilation, but prebuilt wheels are available for common platforms. Breaking changes in version 1.0.0 (SCALING_FACTOR removal) may affect legacy code, so review migration notes if upgrading from 0.9.3b0.
Install
pyclipper on PyPI
pip
pip install pyclipperuv
uv add pyclipperpoetry
poetry add pyclipperInstalling pyclipper
Before you install
Medium install friction due to compiled C++ extension; however, prebuilt wheels are available for Python 3.10–3.14 across Windows, macOS, and Linux platforms. Package is aging (256 days since last release) but repository remains active with 261 stars and no archived status.
License in practice
MIT license (permissive); the underlying Clipper library is Boost Software License (freeware for open source and commercial use). No licensing restrictions on your use of pyclipper.
Quickstart
pip install pyclipper
import pyclipper
pc = pyclipper.Pyclipper()
pc.AddPath(((190, 210), (240, 210), (240, 130), (190, 130)), pyclipper.PT_CLIP, True)
pc.AddPaths((((180, 200), (260, 200), (260, 150), (180, 150)),), pyclipper.PT_SUBJECT, True)
solution = pc.Execute(pyclipper.CT_INTERSECTION, pyclipper.PFT_EVENODD, pyclipper.PFT_EVENODD)
Requires Python 3.10 or later; compiled extension may require build tools if installing from source rather than a prebuilt wheel.
Verify before relying
- Whether the package is actively maintained going forward (last release 256 days ago, status marked 'aging').
- Performance characteristics and scalability limits for large polygon datasets or complex clipping operations.
- Availability of documentation beyond the README and GitHub wiki.
Package facts
| License | MIT (permissive) |
| Python support | supports the current Python release (>=3.10) |
| Install friction | medium — platform-specific wheel |
| Runtime dependencies | none |
| Maintenance | aging — 256 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 11,792,148/month — #1,361 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: pyclipper-1.4.0-cp310-cp310-macosx_10_9_universal2.whl; pyclipper-1.4.0-cp310-cp310-macosx_10_9_x86_64.whl; pyclipper-1.4.0-cp310-cp310-manylinux2014_x86_64.manylinux_2_17_x86_64.whl; pyclipper-1.4.0-cp310-cp310-manylinux_2_24_aarch64.manylinux_2_28_aarch64.whl; pyclipper-1.4.0-cp310-cp310-win32.whl; pyclipper-1.4.0-cp310-cp310-win_amd64.whl; pyclipper-1.4.0-cp311-cp311-macosx_10_9_universal2.whl; pyclipper-1.4.0-cp311-cp311-macosx_10_9_x86_64.whl; pyclipper-1.4.0-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.whl; pyclipper-1.4.0-cp311-cp311-manylinux_2_24_aarch64.manylinux_2_28_aarch64.whl; pyclipper-1.4.0-cp311-cp311-win32.whl; pyclipper-1.4.0-cp311-cp311-win_amd64.whl; pyclipper-1.4.0-cp312-cp312-macosx_10_13_universal2.whl; pyclipper-1.4.0-cp312-cp312-macosx_10_13_x86_64.whl; pyclipper-1.4.0-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.whl; pyclipper-1.4.0-cp312-cp312-manylinux_2_24_aarch64.manylinux_2_28_aarch64.whl; pyclipper-1.4.0-cp312-cp312-win32.whl; pyclipper-1.4.0-cp312-cp312-win_amd64.whl; pyclipper-1.4.0-cp313-cp313-macosx_10_13_universal2.whl; pyclipper-1.4.0-cp313-cp313-macosx_10_13_x86_64.whl
Keywords: polygon clipping, polygon intersection, polygon union, polygon offsetting, polygon boolean, polygon, clipping, clipper, vatti
Tags
More Python Modules packages
Converts domain names between Unicode and…
permissive · top 100 on PyPI
setuptoolsSetuptools is a Python build backend and…
permissive · top 100 on PyPI
PyYAMLPyYAML parses and emits YAML 1.1 data format,…
permissive · top 100 on PyPI
pydanticPydantic validates Python data structures…
permissive · top 100 on PyPI
annotated-typesProvides reusable metadata objects for use with…
permissive · top 100 on PyPI
typing-inspectionProvides runtime tools to inspect and…
permissive · top 100 on PyPI
skia-pathopsPython bindings for Google Skia's Path Ops…
permissive · top 15,000 on PyPI
shapely-polyskelComputes the straight skeleton of a polygon, a…
copyleft · top 15,000 on PyPI
mapbox-earcutFast 2D polygon triangulation using the Mapbox…
permissive · top 5,000 on PyPI
gdstkGdstk is a Python module for creating and…
unclear · top 15,000 on PyPI
exactextractexactextract computes zonal statistics—fast…
permissive · top 15,000 on PyPI
shapelyShapely provides Python tools for creating,…
permissive · top 1,000 on PyPI
pygeoifPyGeoIf provides lightweight, pure-Python…
copyleft · top 15,000 on PyPI
svgpathtoolsReads, writes, and analyzes SVG Path objects…
permissive · top 5,000 on PyPI
descartesConverts geometric objects and GeoJSON-like…
permissive · top 15,000 on PyPI