Peartree is a library for converting GTFS to directed graphs.
Project description
Peartree 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.
Above, an example of multiple Bay Area transit operators being incrementally loaded into Peartree.
Installation
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.
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.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
Built Distribution
Hashes for peartree-0.1.3-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8951f3d4677681fd20381f9c3edeba1fb38a3690d391e2ea652299928d0adb34 |
|
MD5 | d21ce8cf454291bbd4e3b688d4ee63ae |
|
BLAKE2b-256 | 97667f52b80667ae76f965113e3268bfe6f5cf76fe677c5b30d1ddde993f43ba |