def get_single_song_dict(db_session, song_id):
    song_dict = {}
    try:
        c = db_session.cursor()
        c.execute("""SELECT album_id, title, track, time, size, artist_name FROM songs
            WHERE song_id = ?""", [song_id])
        for row in c:
            album_id    = row[0]
            song_title  = row[1]
            song_track  = row[2]
            song_time   = row[3]
            song_size   = row[4]
            artist_name = row[5]
            song_dict = {   'album_id'    : album_id,
                    'song_title'  : song_title,
                    'song_track'  : song_track,
                    'song_time'   : song_time,
                    'song_size'   : song_size,
                    'song_id'     : song_id,
                    'artist_name' : artist_name,
                    }
        c.execute("""SELECT name, album_id, precise_rating FROM albums
            WHERE album_id = ?""", [song_dict['album_id']])
        data = c.fetchone()
        song_dict['album_name']    = data[0]
        song_dict['artist_id']     = data[1]
        song_dict['precise_rating'] = data[2]
    except:
        song_dict = None
    #db_session.commit()
    c.close()
    return song_dict
Returns a dictionary of one song based on its song_id
dataset/ETHPy150Open bahamas10/Viridian/AmpacheTools/dbfunctions.py/get_single_song_dict