Skip to main content

Peartree is a library for converting GTFS to directed graphs.

Project description

===========
Peartree 🍐🌳
===========

.. image:: https://img.shields.io/travis/kuanb/peartree.svg
:target: https://travis-ci.org/kuanb/peartree

Peartree is a library for converting `GTFS <https://developers.google.com/transit/gtfs/>`__ feed schedules into a representative directed network graph. The tool uses `Partridge <https://github.com/remix/partridge>`__ to convert the target operator schedule data into `Pandas <https://github.com/pandas-dev/pandas>`__ dataframes and then `NetworkX <https://networkx.github.io/>`__ to hold the manipulated schedule data as a directed multigraph.

.. figure:: examples/example.gif
:alt: graph loader animation

Above, an example of multiple Bay Area transit operators being incrementally loaded into Peartree.

Usage
-----

.. 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)

Installation
------------

Note: Still a WIP. Current version on PyPI not good...

.. code:: console

pip install peartree



Project details


Download files

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

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

peartree-0.1.2-py2.py3-none-any.whl (11.6 kB view hashes)

Uploaded Python 2 Python 3

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