def getPlaylists(sp, username, offset=0):
    """
    Retrieves all the playlists a user has

    :param sp:
        A spotipy.Spotify object to be used for the request.

    :param username:
        The username of the user who's playlists you want the retrieve.
    
    :param offset:
        Do not worry about this parameter, it is used for recursion.
    
    :returns:
        A dict containing all of the user's playlists.
    """
    limit = 50

    api_response = sp.user_playlists(username, limit, offset)

    playlists = [x for x in api_response["items"]]

    if api_response["total"] > limit + offset:
        next_playlists = getPlaylists(sp, username, offset + limit)
        for playlist in next_playlists:
            playlists.append(playlist)
    
    return playlists