libpysal
Core components of PySAL - A library of spatial analysis functions
Decision gist · record as of 2026-08-14
Yes, if you are building spatial analysis workflows or using other PySAL packages—libpysal is a required foundation. The active maintenance, permissive license, low install friction, and zero known vulnerabilities make it a safe dependency. Not necessary as a standalone tool for general users; install only if spatial weights, computational geometry, or PySAL integration is part of your project.AI-flagged interpretation of the facts on this page — verify before relying
Before you install
- Requires Python 3.12 or later; geopandas and its geospatial dependencies (GEOS, PROJ) must be installed and functional.
- Low install friction with a pure-Python wheel distribution.
- Actively maintained with a recent release 42 days ago and ongoing GitHub activity; requires Python 3.12 or later.
License · maintenance · safety
BSD 3-Clause (permissive) — BSD 3-Clause permissive license allows use in commercial and proprietary projects with minimal restrictions beyond attribution.
last release 2026-07-03 (42 days) · last repo commit 2026-07-21 · 292 stars
0 known vulnerabilities (OSV.dev, 2026-08-14) · 523,733 downloads/mo, #6,193 on PyPI
Alternatives
Verify before relying
pip install libpysal
import libpysal
from libpysal.weights import Queen
from libpysal.examples import load_example
# Load example geodataframe
gdf = load_example('columbus')
# Create spatial weights from geometry
w = Queen.from_dataframe(gdf)- Whether the 11 runtime dependencies (including geopandas, scipy, scikit-learn) are all required for basic use or if some are optional for specific modules.
- Performance characteristics or scalability limits for large spatial datasets or graphs.
What it is and what it does
libpysal is the foundational library for the PySAL (Python Spatial Analysis Library) ecosystem, providing five core modules: computational geometry (cg), built-in example datasets, a graph class for spatial weights matrices, input/output utilities, and legacy spatial weights support. It sits at the base of a larger family of spatial analysis packages and is designed to be imported and used by downstream PySAL tools rather than as a standalone end-user application.
The package depends on a substantial stack including geopandas, scipy, scikit-learn, numpy, pandas, and shapely, making it suitable for environments already engaged in scientific computing or geospatial work. It targets researchers and practitioners in spatial statistics and GIS applications who need reliable, well-maintained primitives for building spatial analysis workflows.
Use it for
- Build spatial weights matrices and graph representations for spatial econometric or statistical models.
- Access computational geometry operations as a foundation for custom spatial analysis tools.
- Load and work with built-in example datasets for prototyping or teaching spatial analysis concepts.
- Integrate spatial analysis capabilities into downstream PySAL packages or custom geospatial applications.
Worth the install?
AI-flagged interpretation of the facts on this page. Verify before relying on it.
Yes, if you are building spatial analysis workflows or using other PySAL packages—libpysal is a required foundation.
The active maintenance, permissive license, low install friction, and zero known vulnerabilities make it a safe dependency. Not necessary as a standalone tool for general users; install only if spatial weights, computational geometry, or PySAL integration is part of your project.
Install
libpysal on PyPI
Before you install
Low install friction with a pure-Python wheel distribution. Actively maintained with a recent release 42 days ago and ongoing GitHub activity; requires Python 3.12 or later.
Requires Python 3.12 or later; geopandas and its geospatial dependencies (GEOS, PROJ) must be installed and functional.
License in practice
BSD 3-Clause permissive license allows use in commercial and proprietary projects with minimal restrictions beyond attribution.
Quickstart
pip install libpysal
import libpysal
from libpysal.weights import Queen
from libpysal.examples import load_example
# Load example geodataframe
gdf = load_example('columbus')
# Create spatial weights from geometry
w = Queen.from_dataframe(gdf)
Verify before relying
- Whether the 11 runtime dependencies (including geopandas, scipy, scikit-learn) are all required for basic use or if some are optional for specific modules.
- Performance characteristics or scalability limits for large spatial datasets or graphs.
Package facts
| License | BSD 3-Clause permissive |
| Python support | Supports the current Python release >=3.12 |
| Install friction | Low. Pure-Python wheel |
| Runtime dependencies | 11 packagesbeautifulsoup4geopandasjinja2numpypackagingpandasplatformdirsrequestsscikit-learnscipyshapely |
| Maintenance | Actively maintained 42 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 523,733 / month, #6,193 on PyPI 30-day window, as of 2026-08-14 |
| Known vulnerabilities | None known OSV.dev, checked 2026-08-14 |
| Classifiers | Intended Audience :: Science/ResearchLicense :: OSI Approved :: BSD LicenseOperating System :: OS IndependentProgramming Language :: Python :: 3Topic :: Scientific/Engineering :: GIS |
Evidence: libpysal-4.15.0-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 › “spatial weights matrices”
- libpysallibpysal provides core spatial analysis building blocks—computational…
- spoptSpopt solves spatial optimization problems including regionalization,…
- spglmFits Gaussian, Poisson, QuasiPoisson, and Logistic generalized linear…
Give your agent the search over MCP, or paste the wish link into any chat.
More GIS packages
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.
pyproj provides a Python interface to PROJ, enabling cartographic projections and coordinate system transformations for geospatial applications.
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.
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.
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.
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.
See also inequality · pysal · splot · esda · spaghetti · pointpats · segregation · access · spatial-access · pyalex