from random import choice, randint

prenoms_file = open('prenoms.csv' , 'r', encoding = 'utf8')
prenoms_liste = [ ligne.split(';')[3].upper() for ligne in prenoms_file]

noms_file = open('noms.csv' , 'r', encoding = 'utf8')
noms_liste = [ ligne.split(',')[0].upper().replace('\'',' ') for ligne in noms_file]

villes_file = open('villes.csv' , 'r', encoding = 'utf8')
villes_liste = [ (ligne.split(',')[1].upper() , ligne.split(',')[2]) for ligne in sorted(villes_file)]

    
tarifs_liste = [ i for i in range(24,46) ]

disciplines_liste = ['Mathématiques', 'Français' , 'Anglais']

requete_sql = ''

table_name = 'lvp_profs'

for _ in range(200):
    requete_sql += 'INSERT INTO ' + table_name + ' (nom, prenom, email, codepostal, ville, domicile_eleve, domicile_prof, collectif, webcam, tarifs, niveaux, disciplines, verif, fictif) VALUES (\''+choice(noms_liste)+'\', \''+choice(prenoms_liste)+'\', \'fictif@gmail.com\', \''+choice(villes_liste)[1]+'\', \''+choice(villes_liste)[0]+'\','+str(randint(0,1))+','+str(randint(0,1))+','+str(randint(0,1))+','+str(randint(0,1))+',\''+str(choice(tarifs_liste))+'\',\'Tous\',\''+choice(disciplines_liste)+'\',1,1);\n'
    
print( requete_sql )