A simple REST API for retrieving bus line and travel information for Antsirabe.
Returns a list of all available travels with their IDs and names.
Response format:
[
{
"id": 7,
"name": "Ambohidrano"
},
{
"id": 67,
"name": "Talata"
}
...
]Find bus lines between two points.
Request body:
{
"primus": 74,
"terminus": 2,
}Response format:
[
{
"id": 4,
"name": "BUS 10",
"primus": {
"id": 42,
"name": "Dale"
},
"termius": {
"id": 24,
"name": "Antsira"
},
"travel": [
{
"id": 42,
"name": "Dale"
},
{
"id": 74,
"name": "Vatofotsy"
},
{
"id": 65,
"name": "Stationnement (Piste)"
},
...
]
}
]- Clone the repository
- Install dependencies:
pip install . - Run the server:
python src/main.py - API will be available at http://localhost:8080
Bus line data is stored in data/travel.json and loaded on startup.