Python script to check bus locations in Belo Horizonte - Brazil.
Requires BeautifulSoup 4 and Requests, you can install them with pip:
[sudo] pip install bs4
[sudo] pip install requests
There are two main methods: getAvailableBusLines
and getBusLocations
. The former returns all available bus lines and the latter returns all available bus locations for a line.
Example:
from jBHTrans import jBHTrans
j = jBHTrans()
lines = j.getAvailableBusLines()
locations = j.getBusLocations(lineNumber=lines[10]["lineNumber"], lineName=lines[10]["lineName"])