Skip to main content

Library for downloading and processing Spanish mobility data from MITMA

Project description

pySpainMobility

A Python package to access, download and starndardise

logo small

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 (version 1) and again from January 2022 onward (version 2). pySpainMobility is a Python package that simplifies access to these datasets and their associated spatial tessellations 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 full documentation of the library is available on the pySpainMobility website and a paper with some examples and further details is available on arXiv. If you are using the library or it content, please use this reference:

Beneduce, C., Gullón Muñoz-Repiso, T., Lepri, B., & Luca, M. (2025). pySpainMobility: a Python Package to Access and Manage Spanish Open Mobility Data

Bibtex:

@misc{beneduce2025pyspainmobility,
      title={pySpainMobility: a Python Package to Access and Manage Spanish Open Mobility Data}, 
      author={Ciro Beneduce and Tania Gullón Muñoz-Repiso and Bruno Lepri and Massimiliano Luca},
      year={2025},
      eprint={2506.13385},
      archivePrefix={arXiv},
      primaryClass={cs.CY},
      url={https://arxiv.org/abs/2506.13385}, 
}

Table of Content

Documentation

The documentation of pySpainMobility classes and functions is available at pyspainmobility.github.io/pySpainMobility

Installation

scikit-mobility for Python >= 3.8 and all it's dependencies are available from conda-forge and can be installed using conda install -c conda-forge scikit-mobility.

Note that it is NOT recommended to install scikit-mobility from PyPI! If you're on Windows or Mac, many GeoPandas / scikit-mobility dependencies cannot be pip installed (for details see the corresponding notes in the GeoPandas documentation).

installation with pip (python >= 3.8 required)

  1. Create an environment venv

     python3 -m venv venv
    
  2. Activate the environment

     source venv/bin/activate
    
  3. Install pySpainMobility

     pip install pyspainmobility
    

installation with conda - miniconda

  1. Create an environment mobility and install pip

     conda create -n mobility pip python=3.9
    
  2. Activate

     conda activate mobility
    
  3. Install pySpainMobility

     conda install -c conda-forge pySpainMobility
    

Examples

Examples can be found in the repository named Examples

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pyspainmobility-1.0.3.tar.gz (16.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pyspainmobility-1.0.3-py3-none-any.whl (16.4 kB view details)

Uploaded Python 3

File details

Details for the file pyspainmobility-1.0.3.tar.gz.

File metadata

  • Download URL: pyspainmobility-1.0.3.tar.gz
  • Upload date:
  • Size: 16.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.10.16

File hashes

Hashes for pyspainmobility-1.0.3.tar.gz
Algorithm Hash digest
SHA256 42ace12033786e1018af5757117b2e816a9c259d2170d1fccdb761b4bb668838
MD5 c90ef61f0ddcdd70f332b6d9dc735fa0
BLAKE2b-256 80127df36f6c675af5611b95fb92127b1564ab25f7d74253467e47d91d9a3059

See more details on using hashes here.

File details

Details for the file pyspainmobility-1.0.3-py3-none-any.whl.

File metadata

File hashes

Hashes for pyspainmobility-1.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 0bf5b0bbb9b37592affa26918ce35d9a86f14de0ac22d198fc4d5341768f4fce
MD5 25bcbc0fd0f6c17648fcb899c3304a80
BLAKE2b-256 683c2002a98523877a550757e6b9a692019996cb5b8bee6d592afe6cdaa5840d

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page