spaghetti
Analysis of Network-constrained Spatial Data
Decision gist · record as of 2026-08-14
Yes, if you work with geographic networks and need graph-theoretic analysis integrated with spatial statistics. The package is actively maintained, has no known vulnerabilities, and fits naturally into the PySAL ecosystem. Install via conda-forge to avoid dependency friction. Not necessary if you only need basic graph algorithms without spatial context.AI-flagged interpretation of the facts on this page — verify before relying
Before you install
- Requires Python >= 3.10 and libspatialindex system library (installed automatically via conda, manual install required for pip on some systems).
- Low friction: pure Python wheel with no compiled dependencies beyond the spatial stack (geopandas, shapely, rtree, scipy).
- Active maintenance as of July 2026 with regular releases since 2018.
License · maintenance · safety
BSD 3-Clause (permissive) — BSD 3-Clause is permissive; you can use, modify, and distribute spaghetti freely in commercial and private projects provided you retain the license notice.
last release 2024-06-21 (784 days) · last repo commit 2026-07-20 · 284 stars
0 known vulnerabilities (OSV.dev, 2026-08-14) · 101,121 downloads/mo, #12,962 on PyPI
Alternatives
Verify before relying
import spaghetti
import geopandas as gpd
# Load a GeoDataFrame of network geometries
net = spaghetti.Network(gdf.geometry)
# Compute shortest path or analyze network topology
path = net.shortest_path(source, target)- Whether the package supports dynamic network updates or only static graph construction.
- Performance characteristics on large networks (node/edge count thresholds).
- Availability of specialized algorithms beyond shortest path and spanning tree.
What it is and what it does
Spaghetti is a Python library for analyzing spatial networks—geographic data structured as graphs of connected line segments and nodes. It originated from PySAL's network module and provides tools for building networks from geographic features, computing network topology, finding shortest paths, and analyzing network events within a spatial context. The library integrates tightly with the PySAL ecosystem, allowing users to combine network analysis with spatial statistics (via esda), spatial weights (via libpysal), and geospatial operations (via geopandas and shapely).
The package is designed for spatial data scientists and researchers studying network-centric phenomena—transportation networks, utility grids, social networks with geographic constraints, and similar structures where both topology and location matter. It depends on eight runtime packages including numpy, scipy, geopandas, and rtree, making it part of a larger geospatial Python stack rather than a standalone tool. Installation via conda-forge is recommended to avoid manual system dependency setup.
Use it for
- Analyze transportation networks to find shortest routes or identify bottlenecks in road or transit systems.
- Study utility infrastructure (power grids, water pipes) as spatial graphs to detect network fragmentation.
- Compute network-constrained distances for spatial statistical tests that account for connectivity.
- Build minimum spanning trees from geographic point or line data for network design problems.
- Integrate network topology with spatial weights for neighborhood analysis along network edges.
Worth the install?
AI-flagged interpretation of the facts on this page. Verify before relying on it.
Yes, if you work with geographic networks and need graph-theoretic analysis integrated with spatial statistics.
The package is actively maintained, has no known vulnerabilities, and fits naturally into the PySAL ecosystem. Install via conda-forge to avoid dependency friction. Not necessary if you only need basic graph algorithms without spatial context.
Install
spaghetti on PyPI
Before you install
Low friction: pure Python wheel with no compiled dependencies beyond the spatial stack (geopandas, shapely, rtree, scipy). Active maintenance as of July 2026 with regular releases since 2018.
Requires Python >= 3.10 and libspatialindex system library (installed automatically via conda, manual install required for pip on some systems).
License in practice
BSD 3-Clause is permissive; you can use, modify, and distribute spaghetti freely in commercial and private projects provided you retain the license notice.
Quickstart
import spaghetti
import geopandas as gpd
# Load a GeoDataFrame of network geometries
net = spaghetti.Network(gdf.geometry)
# Compute shortest path or analyze network topology
path = net.shortest_path(source, target)
Verify before relying
- Whether the package supports dynamic network updates or only static graph construction.
- Performance characteristics on large networks (node/edge count thresholds).
- Availability of specialized algorithms beyond shortest path and spanning tree.
Package facts
| License | BSD 3-Clause permissive |
| Python support | Supports the current Python release >=3.10 |
| Install friction | Low. Pure-Python wheel |
| Runtime dependencies | 8 packagesesdageopandaslibpysalnumpypandasrtreescipyshapely |
| Maintenance | Actively maintained 784 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 101,121 / month, #12,962 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: spaghetti-1.7.6-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 network analysis”
- spaghettiSpaghetti analyzes network-based spatial data by building…
- pysalPySAL is a meta-package that bundles 29 spatial analysis libraries…
- cityseerComputes network centrality, land-use accessibility, mixed-use…
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 esda · spopt · giddy · pysal · inequality · libpysal · rtree · pointpats · ripser · scikit-network