{"id":14036957,"url":"https://github.com/bmander/busbuzzard","last_synced_at":"2026-04-03T21:22:30.028Z","repository":{"id":10006243,"uuid":"12041645","full_name":"bmander/busbuzzard","owner":"bmander","description":"Inference of probabilistic schedules from empirical data about transit vehicles.","archived":false,"fork":false,"pushed_at":"2013-09-05T21:34:50.000Z","size":320,"stargazers_count":10,"open_issues_count":0,"forks_count":2,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-08-13T03:06:22.194Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/bmander.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2013-08-11T19:53:51.000Z","updated_at":"2024-06-26T17:02:35.000Z","dependencies_parsed_at":"2022-08-07T05:15:21.997Z","dependency_job_id":null,"html_url":"https://github.com/bmander/busbuzzard","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bmander%2Fbusbuzzard","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bmander%2Fbusbuzzard/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bmander%2Fbusbuzzard/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bmander%2Fbusbuzzard/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bmander","download_url":"https://codeload.github.com/bmander/busbuzzard/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":227762358,"owners_count":17816012,"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":[],"created_at":"2024-08-12T03:02:21.667Z","updated_at":"2026-04-03T21:22:29.998Z","avatar_url":"https://github.com/bmander.png","language":"Python","readme":"Busbuzzard\n==========\n\nInference of probabilistic schedules from empirical data about transit vehicles.\n\n## Massage GPS data into a set of observed stop_time events\n\n#### Step 0: Get the data\n\n* A CSV of points logged from the NextBus API.\n  * For example: https://dl.dropboxusercontent.com/u/1158424/route_5.csv.zip\n  * Try to find someone with a larger data dump, to get a larger data dump.\n* An unzipped GTFS that describes the service recorded in the NextBus CSV\n  * Try http://www.gtfs-data-exchange.com/ for current and past GTFS feeds\n\n#### Step 1: Slice a route out of the NextBus CSV dump\n\n`$ python slice_route.py data/nextbus.csv data/route_27.csv 27`\n\n#### Step 2: Chain NextBus vehicle fixes into strings representing trip instances\n\n`$ python chain.py data/route_27.csv data/route_27_chained.csv`\n\n#### Step 3: Assign NextBus fix chains to GTFS trips\n\n`$ python python match.py data/route_27_chained.csv data/your_gtfs_dir 27 data/route_27_your_gtfs.matches`\n\n#### Step 4: Cache GTFS patterns\n\n`$ python find_gtfs_patterns.py data/your_gtfs_dir data/your_gtfs_patterns.json`\n\n#### Step 5: Compute passbys\n\n`$ python passby.py data/your_gtfs_dir data/your_gtfs_patterns.json data/route_27_chained.csv data/route_27_your_gtfs.matches data/route_27_your_gtfs_passbys.csv`\n\n## Visualize scheduled and observed stop_time events\n\nRun viz_stop.py without stop, pattern, or service_id qualifiers\n\n`python viz_stop.py data/route_5_fallwinter_passbys.csv data/sfmta_fallwinter_2012`\n\nWhich complains that it needs a stop_id, but helpfully gives you some options, like:\n\n\u003ePick a stop. Here are some options:\u003cbr\u003e\n\u003estop:3923\t count:1386\u003cbr\u003e\n\u003estop:3927\t count:18021\u003cbr\u003e\n\u003estop:4228\t count:21447\u003cbr\u003e\n\u003estop:4229\t count:23270\u003cbr\u003e\n\u003estop:4224\t count:20978\u003cbr\u003e\n\u003estop:4225\t count:23290\u003cbr\u003e\n\nPick one and run again with a stop\n\n`python viz_stop.py data/route_5_fallwinter_passbys.csv data/sfmta_fallwinter_2012 4228`\n\nNow it complains that you need a direction, but supplies some, like:\n\n\u003ePick a direction. Here are some options:\u003cbr\u003e\n\u003edirection:1\t count:21447\u003cbr\u003e\n\nPick one and run again, then it compains that you need a service_id, on account of how a pattern can run on different service_ids\n\n`python viz_stop.py data/route_5_fallwinter_passbys.csv data/sfmta_fallwinter_2012 4228 1`\n\n\u003ePick a service_id. Here are some options:\u003cbr\u003e\n\u003eservice_id:1\t count:15780\u003cbr\u003e\n\u003eservice_id:3\t count:2896\u003cbr\u003e\n\u003eservice_id:2\t count:2771\u003cbr\u003e\n\nFinally select a service_id:\n\n`python viz_stop.py data/route_5_fallwinter_passbys.csv data/sfmta_fallwinter_2012 4228 1 1`\n\nWhich brings up a pyplot window illustrating a timeline of every scheduled and observed event at stop 4228, on direction 1, with a service_id of 1.\n\n![alt tag](https://raw.github.com/bmander/busbuzzard/master/static/observed_schedule.png)\n\n## Visualize empirical schedule\n\n`python viz_waits.py data/route_5_fallwinter_passbys.csv data/sfmta_fallwinter_2012/ 4228 1 1`\n\nCreates a matplotlib window with contents like:\n\n![alt tag](https://raw.github.com/bmander/busbuzzard/master/static/empiricalsched.png)\n\nEach line plots the quantile of the time to arrival of the next vehicle. The X axis represents time, in minutes, since midnight. The Y axis is seconds wait. The blue line is the time under which a vehicle arrived 25% of the time. The green line represents the amount of time under which a vehicle arrived half the time. Red, 75%, and teal 95%.\n","funding_links":[],"categories":["Producing Data","Python","Uncategorized"],"sub_categories":["GTFS","Uncategorized"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbmander%2Fbusbuzzard","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbmander%2Fbusbuzzard","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbmander%2Fbusbuzzard/lists"}