import pyodbc
server = 'datamartid.datamart.pbidedicated.windows.net'
database = 'master'
authentication = 'ActiveDirectoryInteractive'
ADusername ='xxx@eyyy.com'
driver= '{ODBC Driver 18 for SQL Server}'
with pyodbc.connect('DRIVER= '+ driver+';SERVER='+server+';PORT=1433;DATABASE='+database+';UID='+ADusername+';Authentication='+authentication) as conn:
    with conn.cursor() as cursor:
        cursor.execute("SELECT TOP 1000 [Numéro livre],CategoriePrix = CASE WHEN [Prix catalogue]<13 THEN 'Premier Prix' WHEN [Prix catalogue] <15 THEN 'Cher' ELSE 'Premium' END,[Titre] , [Prix catalogue] FROM Model.Livres")
        row = cursor.fetchall()
        for i in range(10):
            print(row[i])