title: Cypher load csv with python
body: <p>I have established a graph database using batch import tool for Neo4j. The data I am working on is generated every day so I need to update my graph database daily. Running the batch import is not a solution as it will clean and upload entire data everyday. I am trying to use the load csv cypher function using python to do so however I am not able to.</p>
  
  <pre><code>ex = USING PERIODIC COMMIT LOAD CSV FROM myfile.csv AS row FIELDTERMINATOR ';'
  ex += MERGE(:a{b:row[0],d:row[1]})
  </code></pre>
  
  <p>I am trying to run this command using py2neo's as</p>
  
  <pre><code>graph = py2neo.Graph()
  graph.cypher.execute(ex)
  </code></pre>
  
  <p>I get an error Invalid input 'G' : expected whitespace, comment, "...string..." or a parameter (line 1, column 37 (offset 36))</p>
  
  <p>Using this link I understand that I have to look over the rows and then I can upload data using py2neo.
  <a href="https://codereview.stackexchange.com/questions/75842/optimizing-for-data-import-in-neo4j-using-py2neo">https://codereview.stackexchange.com/questions/75842/optimizing-for-data-import-in-neo4j-using-py2neo</a></p>
  
  <p>Is there a way to run load csv directly using python over an a csv? Writing look is not a problem however, this adds on to extra computation.</p>
  
  <p>Thanks in advance for answers :)</p>