$npx skillfedfor your agent

GeoAlchemy2

Using SQLAlchemy with Spatial Databases

Worth itPyPI GISReleased May 20265.2M downloads / moMITPure Python

Decision gist · record as of 2026-08-14

pure-Python wheel — geoalchemy2-0.20.0-py3-none-any.whl
v0.20.0 · released 2026-05-12 · Python >=3.10 · 2 runtime deps: SQLAlchemy, packaging

Yes. GeoAlchemy2 is actively maintained, has low install friction, carries a permissive MIT license, and fills a clear need for ORM-based spatial database access. It is well-established and supports current Python versions. Install it if you need to work with geographic data in a SQLAlchemy-based application.AI-flagged interpretation of the facts on this page — verify before relying

Before you install

  • Requires a spatial database backend (such as PostGIS) to be installed and configured separately; Python 3.10 or later.
  • Low friction installation with only two runtime dependencies (SQLAlchemy and packaging).
  • Active maintenance with recent releases and a stable repository.

License · maintenance · safety

MIT (permissive) — MIT license permits commercial and private use with minimal restrictions.

last release 2026-05-12 (94 days) · last repo commit 2026-07-22 · 709 stars

0 known vulnerabilities (OSV.dev, 2026-08-14) · 5,163,891 downloads/mo, #2,152 on PyPI

Verify before relying

pip install geoalchemy2

from geoalchemy2 import Geometry
from sqlalchemy import Column, Integer, create_engine
from sqlalchemy.orm import declarative_base

Base = declarative_base()

class Location(Base):
    __tablename__ = 'locations'
    id = Column(Integer, primary_key=True)
    geom = Column(Geometry('POINT'))
  • Which spatial database backends are supported (PostGIS, SpatiaLite, etc.)
  • Whether a spatial database system must be installed separately
  • Performance characteristics for large geographic datasets
Same gist for agents: .md · .json

What it is and what it does

GeoAlchemy2 is a Python toolkit that bridges SQLAlchemy and spatial databases, allowing you to work with geographic data types and spatial queries through an ORM interface. It builds on SQLAlchemy's declarative system to map geographic columns and operations to database-native spatial types, letting you query and manipulate geographic data using Python objects rather than raw SQL.

The package is designed for applications that need to store, retrieve, and analyze geographic information—such as location-based services, mapping applications, or GIS analysis workflows. It handles the translation between Python spatial objects and the spatial data types supported by your underlying database, abstracting away database-specific SQL syntax for common geographic operations.

Use it for

  • Build location-based web services that query geographic points, polygons, or routes stored in a spatial database
  • Develop GIS analysis tools that need to perform spatial operations like distance calculations or intersection tests through an ORM
  • Create mapping applications that store and retrieve geographic features alongside relational data
  • Implement geofencing or proximity-based filtering in applications backed by a spatial database

Worth the install?

AI-flagged interpretation of the facts on this page. Verify before relying on it.

Worth it

Yes.

GeoAlchemy2 is actively maintained, has low install friction, carries a permissive MIT license, and fills a clear need for ORM-based spatial database access. It is well-established and supports current Python versions. Install it if you need to work with geographic data in a SQLAlchemy-based application.

Install

geoalchemy2 on PyPI

Before you install

Low friction installation with only two runtime dependencies (SQLAlchemy and packaging). Active maintenance with recent releases and a stable repository.

Requires a spatial database backend (such as PostGIS) to be installed and configured separately; Python 3.10 or later.

License in practice

MIT license permits commercial and private use with minimal restrictions.

Quickstart

pip install geoalchemy2

from geoalchemy2 import Geometry
from sqlalchemy import Column, Integer, create_engine
from sqlalchemy.orm import declarative_base

Base = declarative_base()

class Location(Base):
    __tablename__ = 'locations'
    id = Column(Integer, primary_key=True)
    geom = Column(Geometry('POINT'))

Verify before relying

  • Which spatial database backends are supported (PostGIS, SpatiaLite, etc.)
  • Whether a spatial database system must be installed separately
  • Performance characteristics for large geographic datasets

Package facts

LicenseMIT permissive
Python supportSupports the current Python release >=3.10
Install frictionLow. Pure-Python wheel
Runtime dependencies
2 packages
SQLAlchemypackaging
MaintenanceActively maintained 94 days since the last release
Last repo commit
First released
Downloads5,163,891 / month, #2,152 on PyPI 30-day window, as of 2026-08-14
Known vulnerabilitiesNone known OSV.dev, checked 2026-08-14
Classifiers
Development Status :: 4 - BetaEnvironment :: PluginsIntended Audience :: Information TechnologyOperating System :: OS IndependentProgramming Language :: PythonProgramming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Topic :: Scientific/Engineering :: GIS

Evidence: geoalchemy2-0.20.0-py3-none-any.whl

Tags

Capabilities
sqlalchemy spatial databasegis orm pythongeographic data sqlalchemyspatial queries ormgeospatial database mappingspatial orm
Topics
gisspatial-dataorm
PyPI keywords
geogissqlalchemyorm

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 › “sqlalchemy spatial database”

  • GeoAlchemy2GeoAlchemy2 extends SQLAlchemy to work with spatial databases,…
  • pygeofilterParses OGC filtering standards (CQL, CQL JSON, JFE, FES) into an…
  • rtreeRtree wraps libspatialindex to provide spatial indexing for Python,…

Give your agent the search over MCP, or paste the wish link into any chat.

More GIS packages

shapely Worth it
PyPI · GIS · released Sep 2025

Shapely provides Python tools for creating, manipulating, and analyzing 2D geometric objects (points, lines, polygons) using the GEOS library, with both scalar and vectorized NumPy-based operations.

BSD-3-Clausecompiled wheel · 3.10+
85.8Mdownloads / mo
pyproj Unrated
PyPI · Scientific/Engineering · released Aug 2025

pyproj provides a Python interface to PROJ, enabling cartographic projections and coordinate system transformations for geospatial applications.

MITcompiled wheel · 3.11+
28.0Mdownloads / mo
geopandas Worth it
PyPI · GIS · released Jun 2026

GeoPandas extends pandas DataFrames to handle geographic data, combining pandas operations with shapely geometry and spatial analysis capabilities that would otherwise require a spatial database.

Install it if you work with geographic data in Python and want to avoid setting up a spatial database or learning a separate GIS tool.

BSD-3-Clausepure Python · 3.10+
24.8Mdownloads / mo
geopy Worth it
PyPI · Python Modules · released Jul 2026

geopy is a Python client for geocoding and distance calculation that converts addresses to coordinates and vice versa using multiple web-based geocoding services, and computes geodesic and great-circle distances between geographic points.

Install it if you need geocoding or distance calculations in your application.

MITpure Python · 3.8+
19.0Mdownloads / mo
pyogrio Worth it
PyPI · GIS · released Jun 2026

Pyogrio provides fast, bulk-oriented read and write access to vector spatial data formats (Shapefile, GeoPackage, GeoJSON, etc.) via GDAL/OGR bindings, typically for use with GeoPandas GeoDataFrames.

MITcompiled wheel · 3.10+
17.2Mdownloads / mo
h3 Worth it
PyPI · GIS · released May 2026

h3 provides Python bindings to Uber's H3 geospatial indexing library, converting geographic coordinates into hierarchical hexagonal grid cells and performing spatial operations on them.

Apache-2.0compiled wheel · 3.10+
12.1Mdownloads / mo

See also SQLAlchemy · pygeofilter · osmium · sqlalchemy-jdbcapi · geodatasets · geoarrow-c · Flask-SQLAlchemy · sqlalchemy-firebird · cmeel-octomap