huff: A Python package for Market Area Analysis
Market area models, such as the Huff model and its extensions, are widely used to estimate regional market shares and customer flows of retail and service locations. Another, now very common, area of application is the analysis of catchment areas, supply structures and the accessibility of healthcare locations. The huff Python package provides a complete workflow for market area analysis, including data import, construction of origin-destination interaction matrices, basic model analysis, parameter estimation from empirical data, calculation of distance or travel time indicators, and map visualization. Additionally, the package provides several methods of spatial accessibility analysis. The package is modular and object-oriented. It is intended for researchers in economic geography, regional economics, spatial planning, marketing, geoinformation science, and health geography. The software is openly available via the Python Package Index (PyPI); its development and version history are managed in a public GitHub Repository and archived at Zenodo.
💡 Research Summary
The paper introduces huff, a comprehensive Python package designed for market‑area analysis (MAA) based on the classic Huff model and its extensions. Market‑area models estimate the share of customers that a retail or service location captures from surrounding origins, and they have become essential tools not only in commercial site selection but also in evaluating the accessibility of public services such as hospitals, schools, and emergency facilities. The authors present huff as a modular, object‑oriented framework that integrates the entire MAA workflow—from raw data ingestion to the generation of spatial visualizations—within a single, reproducible Python environment.
Core Architecture
huff is organized into four primary sub‑packages:
- huff.io – Handles data import from CSV, Excel, Shapefile, GeoJSON, and other common formats using pandas and geopandas. It also performs coordinate‑system transformations, missing‑value handling, and basic attribute cleaning.
- huff.model – Implements the probabilistic Huff choice function
\