Example #1
0
def more_info_artist(information):
    #graphs, image option
    menu.refresh()
    print(menu.detailed_artist_menu)
    information2 = api.get_artist_info('beyonce')
    answer = input('>')

    if answer == '1':
        #followercount
        trace1 = [information[2], information2[2]]
        #artistname
        trace2 = [information[1], information2[1]]
        plotlygraphs.plot_graph1(trace1, trace2)
    elif answer == '2':
        #popularity
        trace1 = [information[3], information2[3]]
        #artistname
        trace2 = [information[1], information2[1]]
        plotlygraphs.plot_graph1(trace1, trace2)
    elif answer == '3':
        scraping.get_image(information[-1], mtype='artist')
        return
    elif answer == '4':
        artist_menu(information)
    else:
        print('Not a valid input')
        menu.pressenter()
Example #2
0
def album_menu(information):
    #Give album album
    menu.refresh()
    print(menu.album_menu.format(*information[1:]))
    answer = input('> ')
    if answer == 'yes':
        more_info_album(information)
    elif answer == 'no':
        return
    else:
        print('Not a valid input')
        menu.pressenter()
Example #3
0
def artist_menu(information):
    #artist artist menu
    menu.refresh()
    print(menu.artist_menu.format(*information[1:]))
    answer = input('> ')
    if answer == 'yes':
        more_info_artist(information)
    elif answer == 'no':
        return
    else:
        print('Not a valid input')
        menu.pressenter()
Example #4
0
        #artistname
        trace2 = [information[1], information2[1]]
        plotlygraphs.plot_graph1(trace1, trace2)
    elif answer == '3':
        scraping.get_image(information[-1], mtype='artist')
        return
    elif answer == '4':
        artist_menu(information)
    else:
        print('Not a valid input')
        menu.pressenter()


while True:
    try:
        menu.refresh()
        answer = interactive()
        number = answer[0]
        search_term = answer[1:]
        if answer == '4' or answer == 'quit':
            print('Goodbye. Have a nice day :)')
            break
        elif number == '1':
            information = api.get_artist_info(search_term)
            db.write_artist(information)
            artist_menu(information)

        elif number == '2':
            information = api.get_album_info(search_term)
            db.write_album(information)
            album_menu(information)