This tool converts NeTEx XML files (Level 1 and Level 2) into a GTFS feed.
Run the script from the command line using Python:
python netex_to_gtfs.py --netexlvl1 <path_to_level1_xml> --netexlvl2 <path_to_level2_xml> [--output <output_directory>] [--zip]--netexlvl1: Path to the Level 1 NeTEx XML file (Required).--netexlvl2: Path to the Level 2 NeTEx XML file (Required).--output: Directory where the GTFS files will be generated. Default isgtfs_output.--zip: If present, zips the output directory into a.zipfile.
python netex_to_gtfs.py --netexlvl1 IT-ITI4-0083_L1.xml --netexlvl2 IT-ITI4-0083_L2.xml --zipThe script generates the following GTFS files in the output directory:
agency.txtstops.txtroutes.txttrips.txtstop_times.txtcalendar_dates.txtshapes.txt(if shape data is available)feed_info.txt
- Progress Tracking: Visual progress bars for parsing and processing steps.
- Optimization: Efficiently handles large XML files using iterative parsing.
- Validation Fixes: Includes logic to handle midnight crossings, deduplicate trips, and filter unused stops.
- Zipping: Automatically zips the output for easy distribution.
- Python 3.x (Standard library only, no external dependencies)