A project to provide REST APIs of BLUEBikes data (Stations and Trips) and dashboard to visualize their summary
The data can be downloaded from the BLUEbikes site. Especially, the following data are used in this project:
- Region information: https://gbfs.bluebikes.com/gbfs/en/system_regions.json
- Station information: https://gbfs.bluebikes.com/gbfs/en/station_information.json
- Trip information: https://s3.amazonaws.com/hubway-data/index.html (You can choose any monthly dataset named as 'YYYYmm-bluebikes-tripdata.zip')
which are also referred at HealthData.gov.
What things you need to install the software and how to install them
Python 2.7.15
pip 19.0.3
- Load required libraries
pip install -r requirements.txt
-
Download one Bluebikes trip history data from here, unzip the file and put a csv file into the data folder.
-
Create database and import some master data (Note: you need to connect to internet because this automatically gets the Region and Station datasets mentioned above). It will take for a while depending on how large your dataset is.
python manage.py migrate
- Start the server
python manage.py runserver
If you can see the Api Root page at http://127.0.0.1:8000/apis via any browser, you have completed installation!
You can also access to the dashboard via http://127.0.0.1:8000/dashboards/.
You can see the list of all the endpoints and their specifications at http://127.0.0.1:8000/docs/.
You can also see the explanations of each endpoint at http://127.0.0.1:8000/apis.
python manage.py test
-
Django - The high-level Python Web framework
-
Django REST framework - The toolkit for building Web APIs
-
django-filter - The toolkit to alleviate writing some of the more mundane bits of view code
-
drf-dynamic-fields - a mixin to dynamically limit the fields per serializer to a subset specified by an URL parameter
-
jQuery - The JavaScript library to make client development much simpler with an easy-to-use API
-
d3.js - The JavaScript library for manipulating documents based on data
-
Leaflet - The JavaScript map library
-
Bootstrap - The front-end component library: the design of this dashboard is based on its example.
-
Font Awesome - The icon set and toolkit