Py2neo is a client library and comprehensive toolkit for working with Neo4j from within Python applications and from the command line. The core library has no external dependencies and has been carefully designed to be easy and intuitive to use.
- Python 2.7 / 3.3 / 3.4
- Neo4j 1.8 / 1.9 / 2.0 / 2.1 / 2.2 (the latest point release of each version is recommended)
To install, run the following::
$ pip install py2neo
I have added merge function to class py2neo.cypher.CreateStatement so you can use it with the builder to completely build a graph. That was a solution to my question on stackoverflow.com
You can call the new function as follows
builder.merge(Node, array of labels, properties, [raw_on_conditional_query])
The function will find the node that matches the given label and properties. If the node isn't found it will create it and it will execute the condition given e.g., on submit SET x=1 ON CREATE SET y=1
Note that the optional raw_on_conditional_query is raw cypher query so you should make sure that data are escaped in it correctly.
For more information, read through the full introduction.
To get in touch, contact me via email or on Twitter.
For the previous stable release, check out the release/1.6.4 branch.