def tour_search(tour):
    "\n    Function to retrieve the information about tour in the Art institute of Chicago\n\n    Parameters:\n    -------------\n    The key word that users want to search,\n    for example: the artist's name, the title of the artwork.\n\n    Returns:\n    -------------\n    Status code: str\n        if the API request went through\n    Dataframe: df\n        includes the related info about the searched tour.\n\n    Example:\n    -------------\n    >>>tour_search('monet')\n       0\t4714\tMonet and Chicago\thttp://aic-mobile-tours.artic.edu/sites/defaul...\t<p>Monet and Chicago presents the city’s uniqu...\t<p>Monet and Chicago is the first exhibition t...\t[Cliff Walk at Pourville, Caricature of a Man ...\t[Claude Monet, Claude Monet, Claude Monet, Cla...\n       1\t4520\tManet and Modern Beauty\thttp://aic-mobile-tours.artic.edu/sites/defaul...\t<p>Dive deep into the life and mind of one the...\t<p>Manet is undoubtedly one of the most fascin...\t[]\t[]\n\n    "
    params_search_tour = {'q': tour}
    rt = requests.get('https://api.artic.edu/api/v1/tours/search?fields=id,image,title,description,intro,artwork_titles,artist_titles', params=params_search_tour)
    try:
        status = rt.status_code
    except HTTPError as http_err:
        print(f'HTTP error occurred: {http_err}')
    except Exception as err:
        print(f'Other error occurred: {err}')
    else:
        print('no error (successfully made request)')
        rt1 = json.dumps(rt.json(), indent=2)
        toursearch = json.loads(rt1)
        ntour = pd.DataFrame(toursearch['data'])
        tour_info = ntour[['id', 'title', 'image', 'description', 'intro', 'artwork_titles', 'artist_titles']]
        return tour_info
Function to retrieve the information about tour in the Art institute of Chicago

Parameters:
-------------
The key word that users want to search,
for example: the artist's name, the title of the artwork.

Returns:
-------------
Status code: str
    if the API request went through
Dataframe: df
    includes the related info about the searched tour.

Example:
-------------
>>>tour_search('monet')
   0        4714    Monet and Chicago       http://aic-mobile-tours.artic.edu/sites/defaul...       <p>Monet and Chicago presents the city’s uniqu...       <p>Monet and Chicago is the first exhibition t...       [Cliff Walk at Pourville, Caricature of a Man ...       [Claude Monet, Claude Monet, Claude Monet, Cla...
   1        4520    Manet and Modern Beauty http://aic-mobile-tours.artic.edu/sites/defaul...       <p>Dive deep into the life and mind of one the...       <p>Manet is undoubtedly one of the most fascin...       []      []
def tour_search(tour):
    "\n    Function to retrieve the information about tour in the Art institute of Chicago\n\n    Parameters:\n    -------------\n    The key word that users want to search,\n    for example: the artist's name, the title of the artwork.\n\n    Returns:\n    -------------\n    Status code: str\n        if the API request went through\n    Dataframe: df\n        includes the related info about the searched tour.\n\n    Example:\n    -------------\n    >>>tour_search('monet')\n       0\t4714\tMonet and Chicago\thttp://aic-mobile-tours.artic.edu/sites/defaul...\t<p>Monet and Chicago presents the city’s uniqu...\t<p>Monet and Chicago is the first exhibition t...\t[Cliff Walk at Pourville, Caricature of a Man ...\t[Claude Monet, Claude Monet, Claude Monet, Cla...\n       1\t4520\tManet and Modern Beauty\thttp://aic-mobile-tours.artic.edu/sites/defaul...\t<p>Dive deep into the life and mind of one the...\t<p>Manet is undoubtedly one of the most fascin...\t[]\t[]\n\n    "
    params_search_tour = {'q': tour}
    rt = requests.get('https://api.artic.edu/api/v1/tours/search?fields=id,image,title,description,intro,artwork_titles,artist_titles', params=params_search_tour)
    try:
        status = rt.status_code
    except HTTPError as http_err:
        print(f'HTTP error occurred: {http_err}')
    except Exception as err:
        print(f'Other error occurred: {err}')
    else:
        print('no error (successfully made request)')
        rt1 = json.dumps(rt.json(), indent=2)
        toursearch = json.loads(rt1)
        ntour = pd.DataFrame(toursearch['data'])
        tour_info = ntour[['id', 'title', 'image', 'description', 'intro', 'artwork_titles', 'artist_titles']]
        return tour_info