Occupancy of charge connectors


#1

Here’s a sample of results from the Occupancy of Charge Connectors api - the total is the count of all dictionaries in the returned json array. The number of available charge connectors being a total of all those dictionaries that had a status = Available

13 Oct 2017 at 19:25 1184 available out of 1432 (82.7%)
14 Oct 2017 at 21:19 1129 available out of 1360 (83.0%)
15 Oct 2017 at 02:33 1187 available out of 1435 (82.7%)
15 Oct 2017 at 19:56 1129 available out of 1359 (83.1%)
16 Oct 2017 at 21:48 1126 available out of 1362 (82.67%)
17 Oct 2017 at 07:13 1189 available out of 1441 (82.51%)

Is the data correct? Are there really less than 20% of the charge connectors in use?

API call was made with Python:

import urllib2,json

url = "https://api.tfl.gov.uk/Occupancy/ChargeConnector"

tflData = urllib2.urlopen(url).read()
topLevelData = json.loads(tflData)

totalChargePoints = 0
totalAvailable    = 0

for chargePoints in topLevelData:
    totalChargePoints = totalChargePoints + 1
    if chargePoints["status"] == "Available":
        totalAvailable = totalAvailable + 1
    
percentageAvailable = round((totalAvailable * 100.00)/totalChargePoints,2)
result = str(totalAvailable) + " available out of " + str(totalChargePoints) 
result = result + " (" + str(percentageAvailable) + "%)"
print result