Social Bicycles route data

bike

 

Local software developer Ryan McGreal (@RyanMcGreal) of RaiseTheHammer.org fame has built a Python module to download your Social Bicycle data. Check it out: github.com/quandyfactory/sobidata

Details taken from the github page…

 

Summary

Download your Social Bicycles (SoBi) route data and save it locally in various formats.

Details

The sobidata module allows you to download your Social Bicycles (SoBi) route data via the applications web API and save it locally in a variety of file formats.

The module uses the requests library to download collections of routes from the SoBi HTTP REST API using HTTP Basic Authentication, as outlined in the SoBi API documentation.

The route data is paginated, and the method that downloads the data calls itself recursively, incrementing the page with each request until there is no more data.

For each route, the module makes a follow-up request to the API to look up the bike name, origin hub address and destination hub address. However, it also stores the results of those requests locally so that a subsequent search for the same bike name or hub address retrieves the result from the local cache rather than making a duplicate API request.

As a result, the data includes three datasets: a list of routes, a list of hubs and a list of bikes. The module also makes a list of totals, calculating the total distance in miles, total distance in km, total duration in seconds, total duration in minutes, total duration in hours, total number of distinct bikes, and total number of distinct hubs.

Once the data is downloaded, you can save it locally in a variety of formats: JSON, XML, Excel 2007 or CSV format. Note that the JSON, XML and Excel 2007 formats save all four datasets, but the CSV format only saves the routes dataset.