{"id":13703938,"url":"https://github.com/kuanb/peartree","last_synced_at":"2025-04-06T03:09:24.676Z","repository":{"id":53776237,"uuid":"110452875","full_name":"kuanb/peartree","owner":"kuanb","description":"peartree: A library for converting transit data into a directed graph for sketch network analysis.","archived":false,"fork":false,"pushed_at":"2023-05-05T14:06:10.000Z","size":1089,"stargazers_count":203,"open_issues_count":23,"forks_count":24,"subscribers_count":12,"default_branch":"master","last_synced_at":"2025-04-04T20:11:51.616Z","etag":null,"topics":["gis","graphs","gtfs","modeling","network-analysis","spatial-analysis","transit"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/kuanb.png","metadata":{"files":{"readme":"README.rst","changelog":"HISTORY.rst","contributing":"CONTRIBUTING.rst","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2017-11-12T17:22:00.000Z","updated_at":"2025-03-11T12:40:03.000Z","dependencies_parsed_at":"2023-12-09T11:43:31.492Z","dependency_job_id":null,"html_url":"https://github.com/kuanb/peartree","commit_stats":{"total_commits":151,"total_committers":5,"mean_commits":30.2,"dds":"0.052980132450331174","last_synced_commit":"494acf962b5d76f0759b400999619641a1f13301"},"previous_names":[],"tags_count":14,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kuanb%2Fpeartree","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kuanb%2Fpeartree/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kuanb%2Fpeartree/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kuanb%2Fpeartree/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kuanb","download_url":"https://codeload.github.com/kuanb/peartree/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247427006,"owners_count":20937201,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["gis","graphs","gtfs","modeling","network-analysis","spatial-analysis","transit"],"created_at":"2024-08-02T21:01:01.979Z","updated_at":"2025-04-06T03:09:24.657Z","avatar_url":"https://github.com/kuanb.png","language":"Python","funding_links":[],"categories":["Producing Data","Python","Planning Coding Resources","Geospatial Library","Uncategorized","Language based Geospatial Libraries"],"sub_categories":["GTFS","Python","Uncategorized"],"readme":"=============\npeartree 🍐🌳\n=============\n\n.. image:: https://img.shields.io/gitter/room/nwjs/nw.js.svg\n        :target: https://gitter.im/peartree_transit\n\n.. image:: https://img.shields.io/pypi/v/peartree.svg\n        :target: https://pypi.python.org/pypi/peartree\n\n.. image:: https://img.shields.io/travis/kuanb/peartree.svg?branch=master\n        :target: https://travis-ci.org/kuanb/peartree\n\n.. image:: https://codecov.io/gh/kuanb/peartree/branch/master/graph/badge.svg\n  :target: https://codecov.io/gh/kuanb/peartree\n\npeartree is a library for converting `GTFS \u003chttps://developers.google.com/transit/gtfs/\u003e`_ feed schedules into a representative directed network graph. The tool uses `Partridge \u003chttps://github.com/remix/partridge\u003e`__ to convert the target operator schedule data into `Pandas \u003chttps://github.com/pandas-dev/pandas\u003e`__ dataframes and then `NetworkX \u003chttps://networkx.github.io/\u003e`_ to hold the manipulated schedule data as a directed multigraph.\n\n.. image:: https://raw.githubusercontent.com/kuanb/peartree/master/examples/example.gif\n\nAbove, an example of multiple Bay Area transit operators being incrementally loaded into peartree.\n\nInstallation\n------------\n\n.. code:: console\n\n    pip install peartree\n\nUsage\n-----\n\nSee a full notebook at `this gist \u003chttps://gist.github.com/kuanb/c54d0ae7ee353cac3d56371d3491cf56\u003e`_ to see a simple, step-by-step iPython Notebook pulling in an AC Transit GTFS feed and converting it to a NetworkX graph.\n\n.. code:: python\n\n    import peartree as pt\n\n    path = 'path/to/actransit_gtfs.zip'\n\n    # Automatically identify the busiest day and\n    # read that in as a Partidge feed\n    feed = pt.get_representative_feed(path)\n\n    # Set a target time period to\n    # use to summarize impedance\n    start = 7*60*60  # 7:00 AM\n    end = 10*60*60  # 10:00 AM\n\n    # Converts feed subset into a directed\n    # network multigraph\n    G = pt.load_feed_as_graph(feed, start, end)\n\nExamples\n--------\n\nI'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.\n\n`Calculating betweeness centrality with Brooklyn bus network \u003chttp://kuanbutts.com/2017/12/13/betweenness-centrality-peartree/\u003e`_\n\n`Combining a peartree transit network and an OpenStreetMap walk network \u003chttp://kuanbutts.com/2018/12/24/peartree-with-walk-network/\u003e`_\n\n`Generating comparative acyclic route graphs \u003chttp://kuanbutts.com/2018/03/15/comparative-routes-mpl/\u003e`_\n\n`Coalescing transit network graphs and spectral clustering methods \u003chttp://kuanbutts.com/2018/04/01/spectral-cluster-transit/\u003e`_\n\n`Exploratory graph analysis with betweenness and load centrality \u003chttp://simplistic.me/playing-with-gtfs-iii-geo-graphs.html\u003e`_\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkuanb%2Fpeartree","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkuanb%2Fpeartree","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkuanb%2Fpeartree/lists"}