import csv


def read_artist_id_csv(csv_file, ignore_y):
	""" This function reads artist_id csv
	@param ignore_y - skip artist with "y" for the "crawled" column in True
					  save every artist ignoring "y" if False
	@return - dict {artist: artist_id} """
	artist_id_dict = dict()
	with open(csv_file, 'r') as fpin:
		reader = csv.reader(fpin, delimiter=',')
		next(reader)
		for row in reader:
			if len(row) > 0:
				if ignore_y or row[2] != "Y":
					artist_id_dict[row[0]] = row[1]
	return artist_id_dict