from hdfs import InsecureClient client = InsecureClient('http://localhost:9870') with open('arbres.csv') as reader, client.write('/user/root/arbres.csv') as writer: for line in reader: writer.write(line)