Madina Python package: Scalable urban network analysis for modeling pedestrian and bicycle trips in cities - Sevtsuk, Andres; Alhassan, Abdulaziz (Journal of transport geography, 2025)
There is growing interest around sustainable mobility in cities, particularly pedestrian mobility, but methodological limitations and scarcity of software tools to analyze the dynamics between pedestrians and urban land uses have limited both research on and policy-relevant planning applications of pedestrian modeling. To address these challenges, we introduce Madina, a new Python package for modeling pedestrian and cycling trips along spatial networks in urban environments. The package enables managing and visualizing spatial network datasets and implements a set of Urban Network Analysis (UNA) tools for measuring pedestrian accessibility to given destination facilities, for identifying critical walking routes between origin-destination types, and for estimating pedestrian flows over network segments. While some of the methods we use for modeling pedestrian trips along networks have been previously implemented in desktop software plugin-ins, such as ArcGIS or Rhinoceros 3D, Madina introduces three new capabilities to researchers and practitioners. First, it incorporates innovative algorithms that enable computationally expensive pedestrian routing assignments to be scaled to larger geographic areas than previously possible the UNA Rhinoceros environment. Second, an implementation in Python offers new and powerful opportunities to automate various types of pedestrian and bic modeling steps through scripts and allows outputs to be connected with other types of analytic tasks, not available in desktop software applications. Enabling complex spatial analysis procedures to be replicated in automated ways contributes to verifiability, reproducibility, and the development of more robust urban science. And third, it presents the first end-to-end implementation of urban network analysis methods in an open-source Python environment, where no proprietary software is needed. We demonstrate the application of Madina tools in New York City, one of the largest pedestrian networks in the world. •We introduce Madina, a Python package to model pedestrian accessibility and flows.•Madina allows reproducible workflows to simulate pedestrian activity in spatial networks.•Innovative algorithms for K-nearest accessibility and route alternatives in large datasets•End-to-end scripting environment for multithreaded network analysis and processing•We illustrate applications in New York City—one of the largest pedestrian networks in the world.