pysal
Meta Package for PySAL - A library of spatial analysis functions
What it is and what it does
PySAL is a meta-package that brings together a curated ecosystem of 29 spatial analysis libraries under one installation. Rather than a monolithic tool, it serves as an entry point to a family of specialized packages organized into four layers: foundational algorithms (libpysal), exploratory analysis (esda, giddy, pointpats, segregation, spaghetti, inequality, momepy), confirmatory modeling (spreg, mgwr, spglm, spint, spml), and applied methods (access, tobler, spopt). The package is designed for geospatial data scientists working with vector data who need to detect spatial patterns, build spatial networks, fit regression models on geographic data, or measure spatial inequality and segregation.
When you install pysal, you gain access to methods for spatial autocorrelation analysis, network-based inference, urban morphometrics, areal interpolation, spatial optimization, and accessibility modeling. The runtime dependencies include geopandas, shapely, scipy, scikit-learn, and pandas—standard tools for geospatial and statistical computing. This is a research-grade library with emphasis on econometric and statistical rigor rather than real-time GIS operations.
Use it for:
- Detect spatial clusters and hot-spots in disease incidence, crime, or economic data using local spatial autocorrelation methods.
- Build and analyze transportation networks or social networks embedded in geographic space using spaghetti and network algorithms.
- Estimate spatial regression models to understand how geographic proximity influences outcomes in econometric studies.
- Measure urban form and morphology by analyzing building footprints and street networks with momepy.
- Calculate spatial accessibility indices to evaluate service coverage or travel-time equity across regions.
- Perform areal interpolation to downscale census or administrative data to finer geographic units.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
PySAL is a meta-package that bundles 29 spatial analysis libraries for geospatial data science, enabling spatial clustering detection, network analysis, spatial regression, and exploratory spatio-temporal analysis on vector data.
Yes, if you are doing geospatial data science or spatial econometrics. PySAL is actively maintained, has no known vulnerabilities, and bundles a mature ecosystem of specialized tools. The permissive BSD license poses no restriction. The main constraint is the Python 3.12 requirement; if you are on an older Python version, you cannot use it. For researchers, urban planners, or data scientists working with geographic data, this is a standard reference library.
Install
pysal on PyPI
pip
pip install pysaluv
uv add pysalpoetry
poetry add pysalInstalling pysal
Before you install
Low install friction with a wheel distribution. Actively maintained with a release 14 days ago and 1519 repository stars. Requires Python 3.12 or later, which narrows compatibility to recent Python versions.
License in practice
BSD 3-Clause permissive license allows use in commercial and proprietary projects with minimal restrictions, requiring only license and copyright notice retention.
Quickstart
pip install pysal
import pysal
from libpysal import weights
from esda import Moran
# Use spatial analysis functions from bundled packages
w = weights.Rook.from_shapefile('data.shp')
moran = Moran(y, w)
Requires Python 3.12 or later; geospatial analysis typically requires shapefiles or GeoDataFrames as input data.
Verify before relying
- Whether all 29 bundled packages are installed by default or if selective installation is possible.
- Performance characteristics and memory footprint when working with large geospatial datasets.
- Compatibility with specific GIS software or data formats beyond the standard vector formats mentioned.
Package facts
| License | BSD 3-Clause (permissive) |
| Python support | supports the current Python release (>=3.12) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 29 — lazy_loader, beautifulsoup4, geopandas, numpy, packaging, pandas, platformdirs, requests, scipy, shapely, scikit-learn, libpysal, access, esda, giddy, inequality, pointpats, segregation, spaghetti, mgwr, momepy, spglm, spint, spml, spreg, tobler, mapclassify, splot, spopt |
| Maintenance | actively maintained — 14 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 108,571/month — #12,552 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: pysal-26.7-py3-none-any.whl
Keywords: spatial statistics, spatial graphs
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
esdaesda computes global and local spatial…
permissive · top 15,000 on PyPI
segregationCalculates over 40 segregation indices—both…
permissive · top 15,000 on PyPI
splotsplot creates static and interactive…
permissive · top 15,000 on PyPI
libpysallibpysal provides core spatial analysis…
permissive · top 15,000 on PyPI
pointpatsPointpats provides statistical methods for…
permissive · top 15,000 on PyPI
momepyMomepy quantifies urban form through…
permissive · top 15,000 on PyPI
spaghettiSpaghetti analyzes network-based spatial data…
permissive · top 15,000 on PyPI
inequalityInequality provides methods for measuring…
permissive · top 15,000 on PyPI
accessCalculates spatial accessibility metrics to…
permissive · top 15,000 on PyPI
spregspreg estimates simultaneous autoregressive…
permissive · top 15,000 on PyPI