Code Monkey home page Code Monkey logo

transx2gtfs's Introduction

transx2gtfs

PyPI version build status Coverage Status DOI

This is a small library to convert transit data from TransXchange format into GTFS -format that can be used with various routing engines such as OpenTripPlanner.

Note!

This package is still in a Beta-phase, so use it at your own risk. Requires more testing. If you find an issue, you can contribute and help solving them by raising an issue.

Features

  • Reads TransXchange xml-files and converts into GTFS feed with all necessary information according the General Transit Feed Specification.
  • Combines multiple TransXchange files into a single GTFS feed if present in the same folder.
  • Uses multiprocessing to parallelize the conversion process.
  • Parses dates of non-operation (bank holidays etc.) which are written to calendar_dates.txt.
  • Uses NaPTAN stops.

Install

The package is available at PyPi and you can install it with:

$ pip install transx2gtfs

Library works and is being tested with Python versions 3.6, 3.7 and 3.8.

Basic usage

After you have installed the library you can use it in a similar manner as any Python library:

>>> import transx2gtfs
>>> data_dir_for_transxchange_files = "data/my_transxchange_files"
>>> output_path = "data/my_converted_gtfs.zip"
>>> transx2gtfs.convert(data_dir_for_transxchange_files, output_path)

After you have successfully converted the TransXchange into GTFS, you can start doing multimodal routing with your favourite routing engine such as OpenTripPlanner:

OTP_example_in_London

Citation

If you use this tool for research purposes, we encourage you to cite this work:

Developers

  • Henrikki Tenkanen, University College London

transx2gtfs's People

Contributors

htenkanen avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.