Skip to main content

A Python tool to convert TransXchange data into GTFS.

Project description

transx2gtfs

PyPI version build status Coverage Status DOI Gitter

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

Project details


Download files

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

Source Distribution

transx2gtfs-0.3.5.tar.gz (8.2 MB view details)

Uploaded Source

File details

Details for the file transx2gtfs-0.3.5.tar.gz.

File metadata

  • Download URL: transx2gtfs-0.3.5.tar.gz
  • Upload date:
  • Size: 8.2 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/2.0.0 pkginfo/0.6.0 requests/2.22.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.32.1 CPython/3.6.3

File hashes

Hashes for transx2gtfs-0.3.5.tar.gz
Algorithm Hash digest
SHA256 81f5cb55daba9b3e5eff4645d9ffad005765769c4902c64c31b60aaa306f823f
MD5 43b67e184771b66ca0d618bc2b03c7c1
BLAKE2b-256 68d06183ef25e435bedec580fd8266c17bb5aeb81b4c33be9d1dae2c89218d4b

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page