A GOV.UK-styled web application that helps small bus operators efficiently capture, validate, and generate TransXChange XML files for submission to the Bus Open Data Service (BODS).
The Bus Open Data Service (BODS) requires all bus operators in the UK to submit their timetables, fares, and location data in specific formats. Small operators often find it challenging to create valid XML files that comply with the TransXChange schema.
This application simplifies the process by:
- Providing a user-friendly form interface following GOV.UK Design System patterns
- Guiding operators through the data entry process step-by-step
- Validating input data against the TransXChange schema requirements
- Generating compliant XML files that can be submitted to BODS
- Comprehensive data collection for operators, services, routes, stops, and journeys
- Built using the GOV.UK Design System for a familiar, accessible user interface
- Step-by-step wizard approach to data collection
- XML validation against the TransXChange 2.4 schema
- Demo-friendly implementation for showcasing to customers
- Built with Python (Flask) for the backend
- Uses the GOV.UK Design System for frontend styling and components
- XML schema validation using
xmlschema
library - Form handling with WTForms and Flask-WTF
-
Clone the repository:
git clone <repository-url> cd bods
-
Create and activate a virtual environment:
python -m venv venv source venv/bin/activate # On Windows, use: venv\Scripts\activate
-
Install dependencies:
pip install -r requirements.txt
-
Run the application:
python app.py
-
Access the application in your web browser at:
http://localhost:5000
bods/
├── app/ # Application package
│ ├── main/ # Main blueprint
│ │ ├── __init__.py
│ │ ├── forms.py # Form definitions
│ │ └── routes.py # Route handlers
│ ├── models/ # Data models
│ ├── static/ # Static files (CSS, JS)
│ ├── templates/ # HTML templates
│ ├── validators/ # Custom validators
│ └── __init__.py # App factory
├── schema/ # TransXChange XML schemas
├── output/ # Generated XML files
├── venv/ # Virtual environment
├── .gitignore # Git ignore file
├── app.py # Application entry point
├── config.py # Configuration
└── requirements.txt # Python dependencies
- Start at the home page and follow the step-by-step process
- Enter operator details including licence information
- Provide service information such as route IDs and line numbers
- Add bus stops along the route
- Enter journey patterns and timetable information
- Review the entered information
- Generate and download the TransXChange XML file
- Submit the downloaded file to the BODS service
- Python 3.7+
- Flask 2.2+
- XML schema validation libraries
Run the test suite with:
pytest
This project is licensed under the terms of the MIT license.
This application follows the GOV.UK Design System guidelines and patterns to ensure a consistent, accessible user experience that will be familiar to users of UK government services.