Repository for group project related to CMPE273.
Check contributers.txt for individual contributions.
Refer requirements.txt for dependencies.
Make sure all the required softwares are installed, MySql is running on the machine and all the tables are created.
python price_comparator.py
https://docs.google.com/document/d/1Dv45fS2HMaT3BaW8PK_gSF6a1j6jddj-Hg97TcsTi7U/edit#
- Plan a trip which consists of a set of places and estimate the total cost between Uber and Lyft.
- You need to store location details and price estimate data into a persistent DB.
- FEEL FREE TO ADD ANY APIS THAT YOU NEED.
-
- Create Location: POST /locations
Call Google Map API to look up coordinates. http://maps.google.com/maps/api/geocode/json?address=1600+Amphitheatre+Parkway,+Mountain+View,+CA&sensor=false
Request
{
"name" : "My Home",
"address" : "123 Main St",
"city" : "San Francisco",
"state" : "CA",
"zip" : "94113"
}
Response
{
"id" : 12345,
"name" : "My Home",
"address" : "123 Main St",
"city" : "San Francisco",
"state" : "CA",
"zip" : "94113",
"coordinate" : {
"lat" : 38.4220352,
"lng" : -222.0841244
}
}
-
- Get a location: GET /locations/12345
Response
{
"id" : 12345,
"name" : "My Home",
"address" : "123 Main St",
"city" : "San Francisco",
"state" : "CA",
"zip" : "94113",
"coordinate" : {
"lat" : 38.4220352,
"lng" : -222.0841244
}
}
-
- Update a location: PUT /locations/12345
Request
{
"name" : "My New Home"
}
-
- Delete a location: DELETE /locations/12345
-
- Plan a trip: POST /trips
Request
{
"start": "/locations/12345",
"others" : [
"/locations/1000",
"/locations/1001",
"/locations/1002",
],
"end": "/locations/12345"
}
Response
{
"id": 200000,
"start": "/locations/12345",
"best_route_by_costs" : [
"/locations/1002",
"/locations/1000",
"/locations/1001",
],
"providers" : [
{
"name" : "Uber",
"total_costs_by_cheapest_car_type" : 125,
"currency_code": "USD",
"total_duration" : 640,
"duration_unit": "minute",
"total_distance" : 25.05,
"distance_unit": "mile"
},
{
"name" : "Lyft",
"total_costs_by_cheapest_car_type" : 110,
"currency_code": "USD",
"total_duration" : 620,
"duration_unit": "minute",
"total_distance" : 25.05,
"distance_unit": "mile"
}
],
"end": "/locations/12345"
}