Built-in functions of the Python module
BubiUser(phoneNumber, pin) (phoneNumber, and pin needs to be a string)
info()- returns user information in JSON (not dictionary) format -> if you want it in dictionary format,import json, and usejson.loads(info())getScreenName()- grabs the screen name frominfo(), and returns itgetLoginKey()- grabs the login key frominfo(), and returns itcallOtherEndpoint(relativeURL, data)(relativeURL needs to be a string, and data needs to be a dictionary) - calls the specifiedendpointwith the specifieddata(plusloginkey,domain,apikey,show_errors), and returns the output. (you can find endpoints here)rentBike(bikeNumber)(bikeNumber needs to be an integer) - rents a bike, and returns the outputgetRentals()- returns information about the user's rentalsgetClosedRentals()- returns closed rentals fromgetRentals()getActiveRentals()- returns active rentalsgetPaymentLinks()- returns information about payment linksgetSubscriptionInfo()- returns the end of the subscription, and the type of the subscriptiongetSubscriptionType()- returns the type of the subscription based ongetSubscriptionInfo()(monthly, or annual)getEndOfSubscription()- returns the end of the subscription based ongetSubscriptionInfo()(date)moreInfo()- returns a LOT of information about the usergetRentalDetails()- returns information about the current rental
BubiMap()
listAllStations()- returns a JSON object containing all stationslistAllBikes()- returns a JSON object containing all bikeslistAllBikesFormatted()- returns a JSON object containing all bikes (without the unnecessary parts)listAllStationsFormatted()- returns a JSON object containing all stations (without the unnecessary parts)getNearestStations(lat, lon)- (lat, and lon needs to be a float) returns a JSON object containing all stations, sorted by proximity tolat, andlon. Distance is counted in geographical degrees. (calculated using the Pythagorean theorem)getNearestStation(lat, lon)- (lat, and lon needs to be a float) returns the nearest station's name by latitude, and longitude (based on the first key ofgetNearestStations)getNearestStationByAddress(address)- returns the nearest station's name by address (usinggetNearestStation(), and OpenStreetMap API)listAllBikesOnStations(stationName)- returns all the bikes on a station (and the number of these bikes, and information about these bikes)countBikesOnStation(stationName)- counts all the bikes on a station (usinglistAllBikesOnStation()), and returns the countergetCoordinatesOfStation(stationName)- returns the coordinates of a station (latitude, longitude)
BubiHelpers()
register()- Work in progress...pinReset(mobile)- Work in progress...getNews()- Returns all the news in JSON formatgetNewsFormatted()- Returns all the news from the mobile app without the unnecessary parts (based ongetNews())readNew(uid)- Returns the HTML page of a specific new article with the given uid (based ongetNewsFormatted()) (uid needs to be an integer)