Skip to main content

This package has the necessary tools to read, analyze and turn mobility data into a graph object

Project description

Mobility Graph

Mobility Graph is a Python package for the creation, manipulation, and study of the mobility systems, dynamics, and functions of complex intermodal mobility networks.

A graph tool for a better network analysis:

The objective of this package is to build a directed (or a multi directed) graph that contains all the basic tools to manipulate the graph and study changes with a focalization on mobility specific functions such as shortest path and network density and connectivity.

Graph structure:
  • Nodes for stops, edges for connected stops with the respective mode.
Analysis tools:
  • Reads different mobility data and builds an adaptive graph to the mode of mobility.
  • Many standard graph algorithms
  • Standard mobility networks analysis tools
Search Algorithm tools:
  • Search algorithm to find all possible paths from origin to destination with the respective modes.
Best Path Algorithm:
  • Search Algorithm to define the best possible route based on the chosen filter. (Mode, walk score, affluence)

Documentation

If you meet the following error on a Windows machine:

A GDAL API version must be specified. Provide a path to gdal-config using a GDAL_CONFIG environment variable or use a GDAL_VERSION environment variable.

Click here for a complete walkthrough.


##Usage This repository contains all project files.

Simple example

"""
Create a generic graph with two nodes and one edge
"""
from mobility_graph import Graph


g = Graph() # creating a graph object

g.add_node(stop_id='a', stop_name='Origin', stop_lon='1', stop_lat='3') 
g.add_node(stop_id='b', stop_name='Destination', stop_lon='5', stop_lat='2')

g.add_edge('a', 'b', 20, 'walk')

for node in g:
    for w in node.get_connections():
        vid = node.get_id()
        wid = w.get_id()
        print ('( %s , %s, %s, %s)' % (vid, wid, node.get_weight(w), node.get_mode(w)))

for node in g:
    print('g.node_dict[%s]=%s' % (node.get_id(), g.node_dict[node.get_id()]))

Installing the package

pip install mobility-graph

Installing Requirements

$ pip install -U -r requirements.txt

Roadmap

The objective of this tool is to contribute to a larger intermodal trip planning framework. For more info please check the this whitepaper

Contribution

You are welcome to create a pull request, for major changes and ideas to improve the framework feel free to open a discussion or send me an email to collaborate.

License

The MIT License (MIT)

Copyright (c) 2020 Transport for Cairo (see LICENSE.txt)

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

mobility_graph-0.0.5.tar.gz (21.0 kB view details)

Uploaded Source

Built Distribution

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

mobility_graph-0.0.5-py3-none-any.whl (3.9 kB view details)

Uploaded Python 3

File details

Details for the file mobility_graph-0.0.5.tar.gz.

File metadata

  • Download URL: mobility_graph-0.0.5.tar.gz
  • Upload date:
  • Size: 21.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/50.3.0 requests-toolbelt/0.9.1 tqdm/4.42.1 CPython/3.7.6

File hashes

Hashes for mobility_graph-0.0.5.tar.gz
Algorithm Hash digest
SHA256 d745d454265dc3765dfbeba1d1453429292aac97bc04de76b2d7896a8f04cdec
MD5 773e1c5e0b7befdf1f20cf7dc67ed0fc
BLAKE2b-256 98cef9ef6f8fd7bd78243828e1d63772955a8f9dc8d4fce69420065baf9c6b26

See more details on using hashes here.

File details

Details for the file mobility_graph-0.0.5-py3-none-any.whl.

File metadata

  • Download URL: mobility_graph-0.0.5-py3-none-any.whl
  • Upload date:
  • Size: 3.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/50.3.0 requests-toolbelt/0.9.1 tqdm/4.42.1 CPython/3.7.6

File hashes

Hashes for mobility_graph-0.0.5-py3-none-any.whl
Algorithm Hash digest
SHA256 d7d10e562769adbd8c19a238e535050c0e66ac3ba2ed0685d5892229c6abbcc8
MD5 33b7f4c03aab763efddf083b95393976
BLAKE2b-256 5ce592b92e42f3921bed7128625e69bd793f2a81db71dc212d64cb68de7cae7c

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