Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/kuanb/peartree
peartree: A library for converting transit data into a directed graph for sketch network analysis.
https://github.com/kuanb/peartree
gis graphs gtfs modeling network-analysis spatial-analysis transit
Last synced: 18 days ago
JSON representation
peartree: A library for converting transit data into a directed graph for sketch network analysis.
- Host: GitHub
- URL: https://github.com/kuanb/peartree
- Owner: kuanb
- License: mit
- Created: 2017-11-12T17:22:00.000Z (about 7 years ago)
- Default Branch: master
- Last Pushed: 2023-05-05T14:06:10.000Z (over 1 year ago)
- Last Synced: 2024-03-14T20:01:07.375Z (8 months ago)
- Topics: gis, graphs, gtfs, modeling, network-analysis, spatial-analysis, transit
- Language: Python
- Homepage:
- Size: 1.04 MB
- Stars: 198
- Watchers: 13
- Forks: 20
- Open Issues: 23
-
Metadata Files:
- Readme: README.rst
- Changelog: HISTORY.rst
- Contributing: CONTRIBUTING.rst
- License: LICENSE
Awesome Lists containing this project
- urban-and-regional-planning-resources - Peartree - Peartree helps explore GTFS data and their network characteristics. (Planning Coding Resources / Python)
README
=============
peartree 🍐🌳
=============.. image:: https://img.shields.io/gitter/room/nwjs/nw.js.svg
:target: https://gitter.im/peartree_transit.. image:: https://img.shields.io/pypi/v/peartree.svg
:target: https://pypi.python.org/pypi/peartree.. image:: https://img.shields.io/travis/kuanb/peartree.svg?branch=master
:target: https://travis-ci.org/kuanb/peartree.. image:: https://codecov.io/gh/kuanb/peartree/branch/master/graph/badge.svg
:target: https://codecov.io/gh/kuanb/peartreepeartree is a library for converting `GTFS `_ feed schedules into a representative directed network graph. The tool uses `Partridge `__ to convert the target operator schedule data into `Pandas `__ dataframes and then `NetworkX `_ to hold the manipulated schedule data as a directed multigraph.
.. image:: https://raw.githubusercontent.com/kuanb/peartree/master/examples/example.gif
Above, an example of multiple Bay Area transit operators being incrementally loaded into peartree.
Installation
------------.. code:: console
pip install peartree
Usage
-----See a full notebook at `this gist `_ to see a simple, step-by-step iPython Notebook pulling in an AC Transit GTFS feed and converting it to a NetworkX graph.
.. code:: python
import peartree as pt
path = 'path/to/actransit_gtfs.zip'
# Automatically identify the busiest day and
# read that in as a Partidge feed
feed = pt.get_representative_feed(path)# Set a target time period to
# use to summarize impedance
start = 7*60*60 # 7:00 AM
end = 10*60*60 # 10:00 AM# Converts feed subset into a directed
# network multigraph
G = pt.load_feed_as_graph(feed, start, end)Examples
--------I've yet to produce a full how-to guide for this library, but will begin to populate this section with any blog posts or notebooks that I or others produce, that include workflows using peartree.
`Calculating betweeness centrality with Brooklyn bus network `_
`Combining a peartree transit network and an OpenStreetMap walk network `_
`Generating comparative acyclic route graphs `_
`Coalescing transit network graphs and spectral clustering methods `_
`Exploratory graph analysis with betweenness and load centrality `_