Skip to content

samheyman/mock-travel-apis

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Mock Travel APIs

Mock travel APIs to use to stub out the real APIs. Used for example in the Taxi Slack Bot app.

Demo

Taxis

{
	"meta":{
		"count": 2,
		"links":{
			"self": "https://mock-travel-apis.herokuapp.com/taxis"
		}
	},
	"data":[
		{
			"state": "free",
			"name": "hyundai",
			"location": {
				"lon": 3.703,
				"lat": 40.41
			},
			"city": "madrid"	
		},
		{
			"state": "free",
			"name": "fiat",
			"location": {
				"lon": 2.1734,
				"lat": 41.38
			},
			"city": "barcelona"	
		},
        ...
    ]
}
{
	"meta":{
		"count": 2,
		"links":{
			"self": "https://mock-travel-apis.herokuapp.com/taxis"
		}
	},
	"data":[
		{
			"state": "free",
			"name": "hyundai",
			"location": {
				"lon": 3.703,
				"lat": 40.41
			},
			"city": "madrid"	
		},
		{
			"state": "free",
			"name": "fiat",
			"location": {
				"lon": 3.732,
				"lat": 40.51
			},
			"city": "madrid"	
		},
        ...
    ]
}
{
	"meta":{
		"count": 1,
		"links":{
			"self": "https://mock-travel-apis.herokuapp.com/taxis"
		}
	},
	"data":[
		{
			"state": "free",
			"name": "hyundai",
			"location": {
				"lon": 3.703,
				"lat": 40.41
			},
			"city": "madrid"	
		},
        ...
    ]
}
{
	"meta":{
		"count": 1,
		"links":{
			"self": "https://mock-travel-apis.herokuapp.com/taxis"
		}
	},
	"data":[
		{
			"state": "hired",
			"name": "hyundai",
			"location": {
				"lon": 3.703,
				"lat": 40.41
			},
			"city": "madrid"	
		},
        ...
    ]
}

Usage

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes.

Prerequisites

What you will need:

  • python 3.6
  • pip
  • pipenv

Installing

To run it locally:

  • install the requirements
pipenv install
  • run the server
pipenv run python server.py
  • you can call the API with the following requests:
GET localhost:8080/taxis
GET localhost:8080/taxis/madrid
GET localhost:8080/taxis/madrid/hyundai
POST localhost:8080/taxis/madrid/hyundai

Built With

  • Bottle - A simple WSGI micro web-framework for Python

Authors

License

This project is licensed under the MIT License - see the LICENSE.md file for details

Acknowledgments

With contribution from:

About

This is a place to generate mock APIs for travel services: taxis, flights, hotels, etc

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages