plpygis
Python tools for PostGIS
Decision gist · record as of 2026-08-14
Yes, if you are writing PL/Python functions for PostgreSQL with PostGIS. The package has no dependencies, is stable, and solves a specific problem well. No, if you do not use PostgreSQL PL/Python or do not work with PostGIS geometries—the GPL-3.0-only license also makes it unsuitable for proprietary projects unless your entire codebase is copyleft-compatible.AI-flagged interpretation of the facts on this page — verify before relying
Before you install
- Requires Python >= 3.9
- Low friction: pure Python wheel with no runtime dependencies.
- Maintenance is aging—last release was 318 days ago, though the repository remains unarchived and the codebase is stable for its narrow use case.
License · maintenance · safety
GPL-3.0-only (copyleft) — Licensed under GPL-3.0-only (copyleft). Any code that imports plpygis must be distributed under a compatible copyleft license; this is a hard constraint for proprietary or permissively-licensed projects.
last release 2025-09-30 (318 days) · last repo commit 2025-10-02 · 24 stars
0 known vulnerabilities (OSV.dev, 2026-08-14) · 373,010 downloads/mo, #7,157 on PyPI
Alternatives
Verify before relying
from plpygis import Point
p = Point((-124.005, 49.005), srid=4326)
print(p.ewkb)
print(p.geojson)
p.z = 1
print(p.wkt)- Whether the package handles all PostGIS geometry types or only a subset
- Performance characteristics when converting large or complex geometries
- Compatibility with recent PostGIS versions
What it is and what it does
plpygis is a pure-Python geometry format converter that bridges PostgreSQL's PL/Python environment and PostGIS. It translates between the binary and text representations that PostGIS uses (WKB, EWKB, WKT, EWKT) and GeoJSON, allowing PL/Python functions to receive PostGIS geometry objects as native Python objects and return them back to the database. The package implements geometry subclasses (Point, LineString, Polygon, MultiPolygon, etc.) that wrap these conversions transparently.
The primary use case is writing PL/Python stored procedures that accept or return PostGIS geometries. When a geometry is passed to a PL/Python function, plpygis converts it into a Python object with accessible properties (x, y, z coordinates, SRID); when the function returns a plpygis object, it is automatically converted back to a PostGIS geometry for storage. This eliminates the need to manually parse or construct binary geometry formats in Python code.
Use it for
- Write PL/Python functions that accept PostGIS geometry arguments and manipulate them as Python objects before returning results to the database.
- Integrate external geospatial services (elevation APIs, geocoding, etc.) with PostGIS by converting geometries to/from Python-friendly formats.
- Convert PostGIS geometries to GeoJSON for serialization to web clients or APIs.
- Parse WKB or WKT geometry strings into Python objects for analysis or transformation outside the database.
- Build geometry objects programmatically in Python and insert them into PostGIS as EWKB or WKT.
Worth the install?
AI-flagged interpretation of the facts on this page. Verify before relying on it.
Yes, if you are writing PL/Python functions for PostgreSQL with PostGIS.
The package has no dependencies, is stable, and solves a specific problem well. No, if you do not use PostgreSQL PL/Python or do not work with PostGIS geometries—the GPL-3.0-only license also makes it unsuitable for proprietary projects unless your entire codebase is copyleft-compatible.
Install
plpygis on PyPI
Before you install
Low friction: pure Python wheel with no runtime dependencies. Maintenance is aging—last release was 318 days ago, though the repository remains unarchived and the codebase is stable for its narrow use case.
Requires Python >= 3.9
License in practice
Licensed under GPL-3.0-only (copyleft). Any code that imports plpygis must be distributed under a compatible copyleft license; this is a hard constraint for proprietary or permissively-licensed projects.
Quickstart
from plpygis import Point
p = Point((-124.005, 49.005), srid=4326)
print(p.ewkb)
print(p.geojson)
p.z = 1
print(p.wkt)
Verify before relying
- Whether the package handles all PostGIS geometry types or only a subset
- Performance characteristics when converting large or complex geometries
- Compatibility with recent PostGIS versions
Package facts
| License | GPL-3.0-only copyleft |
| Python support | Supports the current Python release >=3.9 |
| Install friction | Low. Pure-Python wheel |
| Runtime dependencies | None |
| Maintenance | Aging 318 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 373,010 / month, #7,157 on PyPI 30-day window, as of 2026-08-14 |
| Known vulnerabilities | None known OSV.dev, checked 2026-08-14 |
| Classifiers | Topic :: DatabaseTopic :: Scientific/Engineering :: GIS |
Evidence: plpygis-0.6.1-py3-none-any.whl
Tags
Let your AI agent find packages like this
Example. Real query, live index.
You found this page by searching. An agent finds it by wishing: SkillFed indexes 14,416 PyPI packages by what they can do, searchable in plain language.
wish › “postgis geometry conversion”
- plpygisConverts geometries between WKB/EWKB, WKT/EWKT, and GeoJSON formats…
- geometConverts between GeoJSON, WKT/WKB, Extended WKT/WKB, GeoPackage…
- shapelyShapely provides Python tools for creating, manipulating, and…
Give your agent the search over MCP, or paste the wish link into any chat.
More Database packages
psycopg2-binary is a PostgreSQL database adapter for Python that implements the DB API 2.0 specification, enabling Python applications to connect to and query PostgreSQL databases with thread-safe concurrent operations.
Python client library for connecting to and executing commands against Redis key-value stores, supporting both synchronous and asynchronous operations.
Install it if your application needs to interact with Redis; the only prerequisite is a running Redis server instance.
YDB Python SDK is the official client library for connecting to and querying YDB databases from Python applications.
Install it if you need to connect Python applications to YDB databases.
Connects Python applications to Snowflake data warehouses using the DB API 2.0 specification, enabling SQL queries, data transfers, and warehouse operations.
sqlparse tokenizes SQL text into a tree of statements, clauses, and expressions, and provides functions to split scripts, format queries, and inspect parsed tokens without validating dialect or syntax.
Install it if you need to manipulate, format, or analyze SQL text programmatically.
Provides base adapter protocols and shared functionality that database adapters use to integrate with dbt-core, handling connections, dialect translation, relation caching, and core interface management.
See also geomet · geoarrow-pandas · geoarrow-types · antimeridian · geojson · arcgis2geojson · pygeoif · osm2geojson · fudgeo · descartes