🤖 AI Summary
Spanish open mobility data face technical barriers—including limited accessibility, heterogeneous formats, and poor timeliness—that hinder empirical applications in epidemiological modeling and transportation planning. To address this, we develop the first open-source Python toolkit for Spain’s national-scale, anonymized mobile signaling data (multiscale, continuously updated since 2020). The toolkit introduces a standardized API interface, integrating functionalities for one-click data download, spatiotemporal filtering, administrative boundary matching, and metadata parsing. Built upon RESTful APIs, GeoPandas, and a modular architecture—with comprehensive Sphinx documentation—it substantially lowers the barrier to using high-dimensional mobility data. Hosted publicly on GitHub, the toolkit supports diverse policy and research applications. It fills a critical gap in locally tailored, timely, and multiscale mobility data tooling, thereby advancing reproducible, public-data-driven social science research.
📝 Abstract
Mobility patterns play a critical role in a wide range of societal challenges, from epidemic modeling and emergency response to transportation planning and regional development. Yet, access to high-quality, timely, and openly available mobility data remains limited. In response, the Spanish Ministry of Transportation and Sustainable Mobility has released daily mobility datasets based on anonymized mobile phone data, covering districts, municipalities, and greater urban areas from February 2020 to June 2021 and again from January 2022 onward. This paper presents pySpainMobility, a Python package that simplifies access to these datasets and their associated study areas through a standardized, well-documented interface. By lowering the technical barrier to working with large-scale mobility data, the package enables reproducible analysis and supports applications across research, policy, and operational domains. The library is available at https://github.com/pySpainMobility.