--- id: spint version: "1.1.0" license: BSD 3-Clause license_treatment: permissive maintenance: active --- # spint — SPatial INTeraction models License: permissive · Maintenance: active · Downloads: 101.4K/mo ## What it is and what it does SpInt is a spatial interaction modeling library that calibrates gravity-type models for analyzing flows between geographic origins and destinations. It implements the Wilson (1971) family of entropy-maximizing models, supporting unconstrained, production-constrained, attraction-constrained, and doubly-constrained variants. All models are fit using iteratively weighted least squares in a generalized linear modeling framework, with results verified against comparable R and statsmodels routines. The package is designed for researchers studying spatial interaction processes—such as migration, trade, or commuting patterns. It provides Poisson and QuasiPoisson estimation, overdispersion tests, model fit statistics (including Moran's I for spatial autocorrelation), local subset calibration for mappable parameter estimates, and three types of spatial weights (origin-destination contiguity, network-based, and vector distance). Sparse data structures are used for memory efficiency and speed. Use it for: - Calibrate gravity models to predict origin-destination flows (e.g., commuting, migration, or trade volumes) from population and distance data. - Test spatial autocorrelation in interaction residuals using vector-based Moran's I to detect model misspecification. - Fit production- or attraction-constrained models when total outflows or inflows are known but individual flows must be estimated. - Generate mappable local parameter estimates and diagnostics by calibrating models on spatial subsets. - Compare overdispersion across Poisson and QuasiPoisson specifications to assess model adequacy for count data. ## Worth the install? AI-flagged interpretation of the facts above — verify before relying. SpInt calibrates spatial interaction models (gravity, production-constrained, attraction-constrained, and doubly-constrained) using an entropy-maximizing framework and iteratively weighted least squares, with support for Poisson and QuasiPoisson count models. Yes. SpInt is actively maintained, has no known vulnerabilities, low install friction, and fills a specialized but well-defined niche in spatial interaction modeling. The BSD 3-Clause license is permissive. Install it if you need to calibrate gravity or constrained spatial interaction models; skip it if your work does not involve origin-destination flow analysis. ## Install pip install spint uv add spint poetry add spint ## Installing spint Before you install: Low install friction; pure Python wheel. Actively maintained with a recent release (58 days old) and current Python 3.12+ support. Depends on established scientific stack (numpy, scipy, libpysal, spglm, spreg). License in practice: BSD 3-Clause permissive license allows commercial and private use with minimal restrictions; attribution required. Quickstart: pip install spint import spint from spint import gravity # Calibrate a spatial interaction model with your origin-destination flow data Requires Python 3.12 or later; depends on scipy, numpy, and libpysal for spatial data structures. Verify before relying: - Whether local subset calibration produces parameter estimates suitable for direct mapping without post-processing. - Performance characteristics when working with large origin-destination matrices or high-dimensional spatial weights. - Current status of Spatial Autoregressive (Lag) model implementation listed as 'In Progress'. ## Package facts - License: BSD 3-Clause (permissive) - Python support: supports_current - Install friction: low - Maintenance: active - Downloads: 101.4K/month (top 15,000 on PyPI) - Known vulnerabilities: none known ## Tags spatial interaction modeling, gravity model calibration, constrained spatial models, spatial interaction analysis, entropy maximizing models, origin destination flows, spatial count data, spatial-analysis, gravity-models, count-data [View on SkillFed](https://skillfed.io/packages/spint) · [View on PyPI](https://pypi.org/project/spint/)