query = (
    """LOAD DATA INFILE '/path/to/my/file' INTO TABLE sometable FIELDS TERMINATED BY ';' ENCLOSED BY '"' ESCAPED BY '\\\\'"""
    )
cursor.execute(query)
connection.commit()
MySQL LOAD DATA LOCAL INFILE example in python?