Note
EDUCATIONAL PROJECT DISCLAIMER
This project is developed purely for educational and demonstrative purposes. While it aims to provide useful public transport information for Milan, it relies on data sources, including scraping information from giromilano.atm.it.
The terms of service for ATM (Azienda Trasporti Milanesi) regarding data usage are not explicitly clear, and this project may potentially violate them.
Therefore:
- Use at Your Own Risk: We do not guarantee the accuracy or continued availability of the data, nor do we assume responsibility for any consequences arising from its use.
- Unscheduled Discontinuation: This project, or parts of it, may be taken down or become non-functional unexpectedly if ATM's policies change or if the data sources become inaccessible.
We advise caution and understanding of these limitations.
The heart of the Onboard Project, this Vercel Python backend is responsible for fetching, processing, and serving real-time public transport data for Milan. It acts as the central data hub for the entire Onboard ecosystem, providing structured information to the client application.
- Real-time Data Scraper: Scrapes live transport data from
giromilano.atm.itto provide accurate arrival and waiting times. - Open Data Integration: Combines scraped data with official open data sources for comprehensive stop and line information.
- Vercel Deployment: Optimized for serverless deployment on Vercel, ensuring high availability and scalability.
- RESTful API: Exposes a clean and well-documented RESTful API for the Onboard SDK and Client to consume.
- Data Caching: Implements intelligent caching mechanisms to reduce load on source systems and improve response times.
The server orchestrates data flow by:
- Periodically fetching the latest stop data, often generated by
onboard-project/stopsgen. - Scraping real-time vehicle arrival information from official transport websites.
- Processing and transforming this raw data into a structured format.
- Serving this enriched data via various API endpoints (e.g., stops, lines, real-time predictions).
The deployed API is accessible at: https://onboard-project-api.vercel.app
Explore the available endpoints and their responses (e.g., /stops, /lines) to understand the data structure.
To set up the server for local development:
- Clone the Repository:
git clone https://github.com/onboard-project/server.git cd server - Create Virtual Environment:
python -m venv venv # On Windows: .\venv\Scripts\activate # On macOS/Linux: source venv/bin/activate
- Install Dependencies:
pip install -r requirements.txt
- Run the Server:
The server will typically run on
uvicorn main:app --reload
http://localhost:8000.
We encourage contributions to the Onboard Server! Whether it's improving scraping logic, optimizing API endpoints, or adding new features, your help is invaluable. Please open issues or submit pull requests.
This project is licensed under the GNU GPL v3.0 License.