All Projects → OpenTransitTools → Gtfsdb

OpenTransitTools / Gtfsdb

Licence: mpl-2.0
GTFS ORM using SQLAlchemy

Programming Languages

python
139335 projects - #7 most used programming language

Labels

Projects that are alternatives of or similar to Gtfsdb

r5r
ipeagit.github.io/r5r/
Stars: ✭ 90 (-14.29%)
Mutual labels:  gtfs
Navitia
The open source software to build cool stuff with locomotion
Stars: ✭ 352 (+235.24%)
Mutual labels:  gtfs
Friendly Public Transport Format
A format for APIs, libraries and datasets containing and working with public transport data.
Stars: ✭ 69 (-34.29%)
Mutual labels:  gtfs
motis
Intermodal Mobility Information System
Stars: ✭ 45 (-57.14%)
Mutual labels:  gtfs
Mapnificent
Mapnificent shows you areas you can reach with public transport in a given time.
Stars: ✭ 302 (+187.62%)
Mutual labels:  gtfs
Loader
deploy
Stars: ✭ 6 (-94.29%)
Mutual labels:  gtfs
partridge
A fast, forgiving GTFS reader built on pandas DataFrames
Stars: ✭ 115 (+9.52%)
Mutual labels:  gtfs
Transitland Datastore
Transitland's centralized web service API for both querying and editing aggregated transit data from around the world
Stars: ✭ 101 (-3.81%)
Mutual labels:  gtfs
Node Gtfs
Import GTFS transit data into SQLite and query routes, stops, times, fares and more.
Stars: ✭ 323 (+207.62%)
Mutual labels:  gtfs
Mpk Ttss
Improved www.ttss.krakow.pl
Stars: ✭ 63 (-40%)
Mutual labels:  gtfs
linked-gtfs
The Linked GTFS vocabulary
Stars: ✭ 36 (-65.71%)
Mutual labels:  gtfs
Home Assistant Config
🏠 Fully documented Home Assistant configuration for a smart-looking place. 😎 Be sure to ⭐️ my repo and copy ideas!
Stars: ✭ 258 (+145.71%)
Mutual labels:  gtfs
Mobility Explorer
Understand transportation networks around the world using Transitland open data and Valhalla routing engine APIs
Stars: ✭ 31 (-70.48%)
Mutual labels:  gtfs
gtfsrdb
GTFSrDB is a tool to archive gtfs-realtime data to a database.
Stars: ✭ 27 (-74.29%)
Mutual labels:  gtfs
Tidytransit
R package for working with the General Transit Feed Specification (GTFS)
Stars: ✭ 84 (-20%)
Mutual labels:  gtfs
gtfs-server
GTFS API Server, written in Rust
Stars: ✭ 13 (-87.62%)
Mutual labels:  gtfs
Awesome Transit
Community list of transit APIs, apps, datasets, research, and software 🚌🌟🚋🌟🚂
Stars: ✭ 713 (+579.05%)
Mutual labels:  gtfs
Gtfspy
Public transport network analysis using Python 🚊🚇🚃🚌🛳️🚡🚠🚞
Stars: ✭ 104 (-0.95%)
Mutual labels:  gtfs
Static Gtfs Manager
GUI interface for creating, editing, exporting of static GTFS data for a public transit authority
Stars: ✭ 98 (-6.67%)
Mutual labels:  gtfs
Gtfs Tripify
Turn GTFS-RT transit updates into historical arrival data.
Stars: ✭ 36 (-65.71%)
Mutual labels:  gtfs

====== GTFSDB

.. image:: https://badges.gitter.im/Join%20Chat.svg :alt: Join the chat at https://gitter.im/OpenTransitTools/gtfsdb :target: https://gitter.im/OpenTransitTools/gtfsdb?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge

Supported Databases

  • PostgreSQL (PostGIS for Geo tables) - preferred
  • Oracle - tested
  • MySQL - tested
  • SQLite - tested

GTFS (General Transit Feed Specification) Database

Python code that will load GTFS data into a relational database, and SQLAlchemy ORM bindings to the GTFS tables in the gtfsdb. The gtfsdb project's focus is on making GTFS data available in a programmatic context for software developers. The need for the gtfsdb project comes from the fact that a lot of developers start out a GTFS-related effort by first building some amount of code to read GTFS data (whether that's an in-memory loader, a database loader, etc...); GTFSDB can hopefully reduce the need for such drudgery, and give developers a starting point beyond the first step of dealing with GTFS in .csv file format.

(Slightly out-of-date version) available on pypi: https://pypi.python.org/pypi/gtfsdb

Install from source via github (if you want the latest code) :

  1. Install Python 3.x https://www.python.org/downloads/ (code also runs on 2.7 if you are stuck on that version)

  2. pip install zc.buildout - https://pypi.org/project/zc.buildout

  3. (optinal step for postgres users: 'pip install psycopg2-binary')

  4. git clone https://github.com/OpenTransitTools/gtfsdb.git

  5. cd gtfsdb

  6. buildout install prod -- NOTE: if you're using postgres, do a 'buildout install prod postgresql'

  7. bin/gtfsdb-load --database_url <gtfs file | url>

    examples:

    NOTE: adding the is_geospatial cmdline flag, when paired with a spatial-database ala PostGIS (e.g., is_spatial is meaningless with sqllite), will take longer to load...but will create geometry columns for both rendering and calculating nearest distances, etc...

  8. view db ( example: https://sqliteonline.com )

The best way to get gtfsbd up and running is via the 'zc.buildout' tool. Highly recommended to first install buildout (e.g., pip install zc.buildout) before doing much of anything else.

Postgres users, gtfsdb requires the psycopg2-binary database driver. Installing that via pip install psychopg2-binary will relieve gtfsdb from re-installing locally as part of the build. And if after the fact, you see exceptions mentioning "ImportError: No module named psycopg2", then 'pip install psychopg2-binary' should fix that up quick...

Example Query:

-- get first stop time of each trip for route_id 1

select * from trips t, stop_times st where t.route_id = '1' and t.trip_id = st.trip_id and st.stop_sequence = 1

-- get agency name and number of routes

select a.agency_name, a.agency_id, count(r.route_id) from routes r, agency a where r.agency_id = a.agency_id group by a.agency_id, a.agency_name order by 3 desc

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].