--- id: libpysal version: "4.15.0" license: BSD 3-Clause license_treatment: permissive maintenance: active --- # libpysal — Core components of PySAL - A library of spatial analysis functions License: permissive · Maintenance: active · Downloads: 523.7K/mo ## 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 above — verify before relying. libpysal provides core spatial analysis building blocks—computational geometry, spatial weights matrices, graph representations, and example datasets—that underpin the broader PySAL ecosystem. 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 pip install libpysal uv add libpysal poetry add libpysal ## Installing libpysal 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. 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) Requires Python 3.12 or later; geopandas and its geospatial dependencies (GEOS, PROJ) must be installed and functional. 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_current - Install friction: low - Maintenance: active - Downloads: 523.7K/month (top 15,000 on PyPI) - Known vulnerabilities: none known ## Tags spatial weights matrices, computational geometry python, spatial graph analysis, spatial statistics library, pysal core components, spatial analysis building blocks, gis python library, spatial-analysis, gis, scientific-computing [View on SkillFed](https://skillfed.io/packages/libpysal) · [View on PyPI](https://pypi.org/project/libpysal/)