1. Routes

Takes a route text for regex matching and returns matching routes in response.

Sample request

curl 'https://bmtcmobileapi.karnataka.gov.in/WebAPI/SearchRoute_v2' \
  -H 'Content-Type: application/json' \
  -H 'User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/138.0.0.0 Safari/537.36' \
  -H 'lan: en' \
  --data-raw '{"routetext":"210"}'

Sample response

{
    "data": [
        {
            "union_rowno": 2,
            "row": 1,
            "routeno": "210-A",
            "responsecode": 200,
            "routeparentid": 7426
        },
        {
            "union_rowno": 2,
            "row": 3,
            "routeno": "210-AA",
            "responsecode": 200,
            "routeparentid": 7427
        }
    ],
    "Message": "Success",
    "Issuccess": true,
    "exception": null,
    "RowCount": 53,
    "responsecode": 200
}

Functions


source

fetch_routes

 fetch_routes (pattern:str='', sleep_duration:float=0.1)

Fetches BMTC routes matching the given pattern, or all routes if pattern is empty.


source

process_routes

 process_routes (routes)

Process and clean route data, returning a DataFrame with route_id and route_number.


source

task_fetch_routes

 task_fetch_routes (data_directory)

source

get_routes

 get_routes (data_directory:pathlib.Path)