Last active
January 12, 2018 17:01
-
-
Save ruliana/d23bd5f430eaca7ddbceb10b594bd986 to your computer and use it in GitHub Desktop.
A deep nesting example in Python
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from neo4j.v1 import GraphDatabase | |
import csv | |
cypher = "MATCH yadda-yadda-yadda" | |
header = ["x", "y"] | |
with open(file, "w") as output: | |
writer = csv.writer(output) | |
writer.writerow(headers) | |
with GraphDatabase.driver("bolt://localhost:7687") as driver: | |
with driver.session() as session: | |
with session.begin_transaction() as tx: | |
for record in tx.run(cypher): | |
writer.writerow([record[header] for header in headers]) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment