Skip to main content

Python mobility library

Project description

pymobility

Work done by South Asia Poverty Team, The World Bank

pymobility is the Python package built on top of PySpark API, which faciliates big data processing. This package has several sub-packages and modules for quantifying mobility and migration from raw GPS data. The package takes delta formatted geo-tagged raw dataset and generates various datasets like Origin Destination matrix and net migration figures, and various statistics like average records in a time-period, average devices registered in a time period, etc.

pymobility has three sub-packages: odm, stm, and eda. odm is used for generating origin-destination figures. stm helps to quantify short term migration depending on whatever definition we use for short term migrants. The stm sub-package is made modular, and there are a number of parameters which can be set according to the definition of short term migrant used. Another sub-package, eda, helps to do exploratory data analysis. We can get statistics like average devices in some time-period, or average records in some time-period, etc. More documentation about the individual sub-packages is done on the sub-package README file itself.

Dependencies

As the package is built on top of PySpark API, Python API for Spark (or PySpark API) should be installed. The code is well tested on Python 3.6, so users are encouraged to have Python 3.6+ version.

Other Python packages used herein are Pandas.

Installation

Both pyspark and pandas can be installed using pip. The commands for them are given below:

pip install pandas
pip install pyspark

More details about pyspark can be found here.

Usage

This package can be used for quantifying mobility and migration from geo-taggged raw delta files. It facilitates following features.

  1. Origin Destination Matrix (OD matrix): Details about use of this library for quantifying origin-destination movement can be found in the README.md file inside the odm sub-package itself.

  2. Short Term Migration: This type of migration is quantified using stm sub-package, which facilitates flexibility in short term migrants' definition with the help of different parameters like away time period required, definition of home, etc.

  3. Exploratory Data Analysis: The exploratory data analysis can be done using the eda sub-package. Under eda commuter aggregates and mobility summary can be quantified. Details about its use can be found in the README.md.

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

pymobility-0.0.8.tar.gz (12.0 kB view details)

Uploaded Source

File details

Details for the file pymobility-0.0.8.tar.gz.

File metadata

  • Download URL: pymobility-0.0.8.tar.gz
  • Upload date:
  • Size: 12.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.7.0 requests/2.22.0 setuptools/51.3.3 requests-toolbelt/0.9.1 tqdm/4.56.0 CPython/3.6.9

File hashes

Hashes for pymobility-0.0.8.tar.gz
Algorithm Hash digest
SHA256 06da4e7b2d6ba8f71489995ad7e05e22c19c9b2725d4081705b37ec88f0caebf
MD5 f02d547b0877106e1b83641df41dbfb8
BLAKE2b-256 6d385de315acbb8c01d88264ba13587eb08f12ec7d46cb2f3643dca394c2b49f

See more details on using hashes here.

Supported by

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