shapely-polyskel
Implementation of the straight skeleton algorithm as described by Felkel and Obdržálek in their 1998 conference paper Straight skeleton implementation.
What it is and what it does
shapely-polyskel implements the straight skeleton algorithm, a geometric technique that computes a medial axis—a set of line segments representing the 'skeleton' of a polygon. It is a fork of an earlier implementation and is based on the 1998 Felkel and Obdržálek algorithm. The package works with shapely Polygon objects and accepts polygons with holes, returning skeleton edges, source points, ridges, and sinks.
The algorithm is dated and the implementation does not attempt to fix known correctness issues; it works reasonably well for real-world inputs like country contours and floor plans but may fail on certain edge cases. It depends on shapely for geometry representation and euclid3 for vector math. The package is in beta status with low install friction, though maintenance is aging.
Use it for:
- Generate roof structures from building footprints or floor plans.
- Compute medial axes for polygon simplification or offset operations.
- Analyze country or region contours to extract skeleton features.
- Create layout networks or centerline representations from polygonal shapes.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Computes the straight skeleton of a polygon, a geometric medial axis useful for floor plans, building contours, and roof generation.
Yes, if you need straight skeleton computation for real-world geometric problems like floor plans or building contours and can tolerate the algorithm's known limitations. No, if you require a modern, fully correct implementation—the author recommends Stefan Huber's research for that. The low install friction and lack of security issues make it safe to try, but verify the algorithm's behavior on your specific inputs first.
Install
shapely-polyskel on PyPI
pip
pip install shapely-polyskeluv
uv add shapely-polyskelpoetry
poetry add shapely-polyskelInstalling shapely-polyskel
Before you install
Low friction; pure Python wheel with only two runtime dependencies (euclid3 and shapely). Maintenance is aging—last release was 586 days ago and the repository has minimal activity (3 stars), though it remains unarchived and the implementation is acknowledged as dated and imperfect for certain inputs.
License in practice
Licensed under LGPLv3 (copyleft). You may use and modify the package freely, but derivative works and combined distributions must also be licensed under compatible terms and include source code availability.
Quickstart
from shapely_polyskel import skeletonize
rectangle = [(40, 40), (40, 310), (520, 310), (520, 40)]
skeleton = skeletonize(polygon=rectangle)
Requires Python 3.10 or later.
Verify before relying
- Whether the implementation's known limitations (acknowledged as 'a bit crap' and incorrect for certain polygons) affect your specific use case.
- Performance characteristics and scalability for large or complex polygons.
Package facts
| License | GNU LESSER GENERAL PUBLIC LICENSE Version 3, 29 June 2007 Copyright (C) 2007 Free Software Foundation, Inc. <https://fsf.org/> Everyone is permitted to copy and distribute verbatim copies of this… (full text in the JSON record) (copyleft) |
| Python support | supports the current Python release (>=3.10) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 2 — euclid3, shapely |
| Maintenance | aging — 586 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 73,570/month — #14,975 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: shapely_polyskel-0.1.2-py3-none-any.whl
Keywords: shapely, geometry, polygon, straight skeleton
Tags
More GIS packages
Shapely provides Python tools for creating,…
permissive · top 1,000 on PyPI
pyprojpyproj provides a Python interface to PROJ,…
permissive · top 1,000 on PyPI
geopandasGeoPandas extends pandas DataFrames to handle…
permissive · top 1,000 on PyPI
geopygeopy is a Python client for geocoding and…
permissive · top 5,000 on PyPI
pyogrioPyogrio provides fast, bulk-oriented read and…
permissive · top 5,000 on PyPI
h3h3 provides Python bindings to Uber's H3…
permissive · top 5,000 on PyPI
descartesConverts geometric objects and GeoJSON-like…
permissive · top 15,000 on PyPI
pyclipperPyclipper performs polygon clipping operations…
permissive · top 5,000 on PyPI
mapbox-earcutFast 2D polygon triangulation using the Mapbox…
permissive · top 5,000 on PyPI
skanAnalyzes skeleton (thin object) images to…
permissive · top 15,000 on PyPI
odc-geoProvides projection-aware geometry classes…
permissive · top 15,000 on PyPI
reprojReproject shapely geometries between coordinate…
permissive · top 15,000 on PyPI
quadrilateral-fitterFits the smallest-area quadrilateral that…
permissive · top 15,000 on PyPI
squarifyComputes treemap layout rectangles from a list…
permissive · top 15,000 on PyPI