def art_search(art):
    "\n    Function to retrieve the information about collections 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 artworks.\n\n    Example:\n    -------------\n    >>>art_search('monet')\n       0\t16568\tWater Lilies\tClaude Monet\nFrench, 1840-1926\tFrance\t1906\t1906\tOil on canvas\t[Painting and Sculpture of Europe, Essentials]\n       1\t16571\tArrival of the Normandy Train, Gare Saint-Lazare\tClaude Monet\nFrench, 1840-1926\tFrance\t1877\t1877\tOil on canvas\t[Painting and Sculpture of Europe]\n    "
    params_search = {'q': art}
    r = requests.get('https://api.artic.edu/api/v1/artworks/search?fields=id,title,date_start,date_end,artist_display,place_of_origin,medium_display,category_titles', params=params_search)
    try:
        status = r.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)')
        r1 = json.dumps(r.json(), indent=2)
        artsearch = json.loads(r1)
        artworks = pd.DataFrame(artsearch['data'])
        artworks_info = artworks[['id', 'title', 'artist_display', 'place_of_origin', 'date_start', 'date_end', 'medium_display', 'category_titles']]
        return artworks_info
Function to retrieve the information about collections 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 artworks.

    Example:
    -------------
    >>>art_search('monet')
       0        16568   Water Lilies    Claude Monet
French, 1840-1926       France  1906    1906    Oil on canvas   [Painting and Sculpture of Europe, Essentials]
       1        16571   Arrival of the Normandy Train, Gare Saint-Lazare        Claude Monet
French, 1840-1926       France  1877    1877    Oil on canvas   [Painting and Sculpture of Europe]
def art_search(art):
    "\n    Function to retrieve the information about collections 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 artworks.\n\n    Example:\n    -------------\n    >>>art_search('monet')\n       0\t16568\tWater Lilies\tClaude Monet\nFrench, 1840-1926\tFrance\t1906\t1906\tOil on canvas\t[Painting and Sculpture of Europe, Essentials]\n       1\t16571\tArrival of the Normandy Train, Gare Saint-Lazare\tClaude Monet\nFrench, 1840-1926\tFrance\t1877\t1877\tOil on canvas\t[Painting and Sculpture of Europe]\n    "
    params_search = {'q': art}
    r = requests.get('https://api.artic.edu/api/v1/artworks/search?fields=id,title,date_start,date_end,artist_display,place_of_origin,medium_display,category_titles', params=params_search)
    try:
        status = r.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)')
        r1 = json.dumps(r.json(), indent=2)
        artsearch = json.loads(r1)
        artworks = pd.DataFrame(artsearch['data'])
        artworks_info = artworks[['id', 'title', 'artist_display', 'place_of_origin', 'date_start', 'date_end', 'medium_display', 'category_titles']]
        return artworks_info