--- id: pygeoif version: "1.6.0" license: LGPL license_treatment: copyleft maintenance: active --- # pygeoif — A basic implementation of the __geo_interface__ License: copyleft · Maintenance: active · Downloads: 370.3K/mo ## What it is and what it does PyGeoIf is a minimal, pure-Python library for constructing and manipulating geospatial geometries. It implements the __geo_interface__ protocol—a GeoJSON-like standard used by many GIS libraries—allowing you to create Points, LineStrings, Polygons, and their multi- and collection variants, then read and write them in WKT (Well Known Text) format or convert them to GeoJSON-compatible dictionaries. The package is designed as a lightweight alternative to Shapely, with no dependencies outside the Python standard library (only typing_extensions at runtime). It supports basic geometric operations like computing bounds, convex hulls, and polygon orientation. It also provides Hypothesis strategies for property-based testing. PyGeoIf is tested on CPython, PyPy, and GraalPy, and was originally written to supply clean, Python-only geometries for the fastkml library. Use it for: - Parse and construct GeoJSON-compatible geometry objects without heavy dependencies - Convert between WKT and Python geometry representations in lightweight applications - Build geospatial libraries that need a standard __geo_interface__ protocol foundation - Generate test geometries using Hypothesis strategies for property-based GIS testing - Embed geometry handling in projects where Shapely's size or compiled dependencies are prohibitive ## Worth the install? AI-flagged interpretation of the facts above — verify before relying. PyGeoIf provides lightweight, pure-Python geometry classes that implement the GeoJSON-like __geo_interface__ protocol for working with geospatial vector data like points, lines, polygons, and their collections. Yes, if you need lightweight GeoJSON-compatible geometry handling without Shapely's compiled dependencies. The active maintenance, copyleft license clarity, and zero external dependencies make it a solid choice for minimal GIS work or as a foundation for custom geospatial libraries. Not suitable if you need advanced spatial operations—use Shapely for that. ## Install pip install pygeoif uv add pygeoif poetry add pygeoif ## Installing pygeoif Before you install: Installation is straightforward with low friction: the package is a pure-Python wheel with only typing_extensions as a runtime dependency. Maintenance is active with recent commits and stable production status. License in practice: PyGeoIf is licensed under LGPL (copyleft), which requires that derivative works and modifications remain under the same or compatible license. Proprietary projects using it must either comply with copyleft terms or seek alternative licensing. Quickstart: pip install pygeoif from pygeoif import geometry p = geometry.Point(1, 1) print(p.__geo_interface__) # {'type': 'Point', 'bbox': (1, 1, 1, 1), 'coordinates': (1, 1)} l = geometry.LineString([(0.0, 0.0), (1.0, 1.0)]) print(l.bounds) # (0.0, 0.0, 1.0, 1.0) Verify before relying: - Performance characteristics compared to Shapely for large geometry datasets - Whether convex_hull and other operations scale adequately for production GIS workloads - Interoperability guarantees with other GIS libraries beyond the __geo_interface__ protocol ## Package facts - License: LGPL (copyleft) - Python support: supports_current - Install friction: low - Maintenance: active - Downloads: 370.3K/month (top 15,000 on PyPI) - Known vulnerabilities: none known ## Tags geojson geometry classes python, wkt well known text parsing, gis vector data lightweight, shapely alternative minimal, geospatial protocol implementation, polygon point linestring python, feature geometry collections, gis-geometry, geojson-protocol, pure-python [View on SkillFed](https://skillfed.io/packages/pygeoif) · [View on PyPI](https://pypi.org/project/pygeoif/)