Last active
September 20, 2020 14:46
-
-
Save gbarreiro/34550febe4a39faf60df581bbbb7544c to your computer and use it in GitHub Desktop.
Best cuisines: setup code
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Define the dependencies | |
import pandas as pd | |
import requests | |
import matplotlib as mpl | |
import matplotlib.pyplot as plt | |
%matplotlib inline | |
mpl.style.use(['seaborn']) | |
# Foursquare API credentials and endpoint | |
CLIENT_ID = # your client ID | |
CLIENT_SECRET = # your client secret | |
VERSION = '20200616' # put today's date | |
URL = 'https://api.foursquare.com/v2/venues/explore?&client_id={}&client_secret={}&v={}&limit={}'.format(CLIENT_ID, CLIENT_SECRET, VERSION, 5000) | |
# List of cities to be explored | |
cities = ["New York, USA", "Tokyo, Japan", "Hong Kong" , "Sydney, Australia", "Barcelona, Spain", "Paris, France", "Moscow, Russia", "Buenos Aires, Argentina", "Mexico DF"] | |
# List of international cuisines (extracted from https://developer.foursquare.com/docs/build-with-foursquare/categories/) | |
cuisines = { | |
'Afghan': '503288ae91d4c4b30a586d67', | |
'African': '4bf58dd8d48988d1c8941735', | |
'American': '4bf58dd8d48988d14e941735', | |
'Burmese': '56aa371be4b08b9a8d573568', | |
'Cambodian': '52e81612bcbc57f1066b7a03', | |
'Chinese': '4bf58dd8d48988d145941735', | |
'Filipino': '4eb1bd1c3b7b55596b4a748f', | |
'Himalayan': '52e81612bcbc57f1066b79fb', | |
'Indonesian': '4deefc054765f83613cdba6f', | |
'Japanese': '4bf58dd8d48988d111941735', | |
'Korean': '4bf58dd8d48988d113941735', | |
'Malay': '4bf58dd8d48988d156941735', | |
'Mongolian': '4eb1d5724b900d56c88a45fe', | |
'Thai': '4bf58dd8d48988d149941735', | |
'Tibetan': '52af39fb3cf9994f4e043be9', | |
'Vietnamese': '4bf58dd8d48988d14a941735', | |
'Australian': '4bf58dd8d48988d169941735', | |
'Austrian': '52e81612bcbc57f1066b7a01', | |
'Bangladeshi': '5e179ee74ae8e90006e9a746', | |
'Belgian': '52e81612bcbc57f1066b7a02', | |
'Caribbean': '4bf58dd8d48988d144941735', | |
'Caucasian': '5293a7d53cf9994f4e043a45', | |
'Czech': '52f2ae52bcbc57f1066b8b81', | |
'Dutch': '5744ccdfe4b0c0459246b4d0', | |
'Belarusian': '52e928d0bcbc57f1066b7e97', | |
'Bosnian': '58daa1558bbb0b01f18ec1ee', | |
'Bulgarian': '56aa371be4b08b9a8d5734f3', | |
'Romanian': '52960bac3cf9994f4e043ac4', | |
'Tatar': '52e928d0bcbc57f1066b7e98', | |
'English': '52e81612bcbc57f1066b7a05', | |
'French': '4bf58dd8d48988d10c941735', | |
'German': '4bf58dd8d48988d10d941735', | |
'Greek': '4bf58dd8d48988d10e941735', | |
'Hawaiian': '52e81612bcbc57f1066b79fe', | |
'Hungarian': '52e81612bcbc57f1066b79fa', | |
'Indian': '4bf58dd8d48988d10f941735', | |
'Italian': '4bf58dd8d48988d110941735', | |
'Salvadoran': '5745c7ac498e5d0483112fdb', | |
'Argentinian': '4bf58dd8d48988d107941735', | |
'Brazilian': '4bf58dd8d48988d16b941735', | |
'Colombian': '58daa1558bbb0b01f18ec1f4', | |
'Peruvian': '4eb1bfa43b7b52c0e1adc2e8', | |
'Venezuelan': '56aa371be4b08b9a8d573558', | |
'Moroccan': '4bf58dd8d48988d1c3941735', | |
'Mexican': '4bf58dd8d48988d1c1941735', | |
'Egyptian': '5bae9231bedf3950379f89e1', | |
'Iraqi': '5bae9231bedf3950379f89e7', | |
'Israeli': '56aa371be4b08b9a8d573529', | |
'Kurdish': '5744ccdfe4b0c0459246b4ca', | |
'Lebanese': '58daa1558bbb0b01f18ec1cd', | |
'Persian': '52e81612bcbc57f1066b79f7', | |
'Syrian': '5bae9231bedf3950379f89da', | |
'Yemeni': '5bae9231bedf3950379f89ea', | |
'Pakistani': '52e81612bcbc57f1066b79f8', | |
'Polish': '52e81612bcbc57f1066b7a04', | |
'Portuguese': '4def73e84765ae376e57713a', | |
'Russian': '5293a7563cf9994f4e043a44', | |
'Scandinavian': '4bf58dd8d48988d1c6941735', | |
'Scottish': '5744ccdde4b0c0459246b4a3', | |
'Slovak': '56aa371be4b08b9a8d57355a', | |
'Spanish': '4bf58dd8d48988d150941735', | |
'Sri Lankan': '5413605de4b0ae91d18581a9', | |
'Swiss': '4bf58dd8d48988d158941735', | |
'Turkish': '4f04af1f2fb6e1c99f3db0bb', | |
'Ukranian': '52e928d0bcbc57f1066b7e96' | |
} | |
# Local cuisine on each city | |
city_local_cuisines = { | |
"New York, USA": "American", | |
"Tokyo, Japan": "Japanese", | |
"Hong Kong": "Chinese", | |
"Sydney, Australia": "Australian", | |
"Barcelona, Spain": "Spanish", | |
"Paris, France": "French", | |
"Moscow, Russia": "Russian", | |
"Buenos Aires, Argentina": "Argentinian", | |
"Mexico DF": "Mexican" | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment