neo4j-rest-client’s documentation¶
synopsis: | Object-oriented Python library to interact with Neo4j standalone REST server. |
---|
The main goal of neo4j-rest-client was to enable Python programmers already using Neo4j locally through python-embedded, to use the Neo4j REST server. So the syntax of neo4j-rest-client’s API is fully compatible with python-embedded. However, a new syntax is introduced in order to reach a more pythonic style and to enrich the API with the new features the Neo4j team introduces.
Getting started¶
The main class is GraphDatabase
, exactly how in python-embedded:
>>> from neo4jrestclient.client import GraphDatabase
>>> gdb = GraphDatabase("http://localhost:7474/db/data/")
If /db/data/
is not added, neo4j-rest-client will do an extra request in
order to know the endpoint for data.
And now we are ready to create nodes and relationhips:
>>> alice = gdb.nodes.create(name="Alice", age=30)
>>> bob = gdb.nodes.create(name="Bob", age=30)
>>> alice.relationships.create("Knows", bob, since=1980)
Although using labels
is usually easier:
>>> people = gdb.labels.create("Person")
>>> people.add(alice, bob)
>>> carl = people.create(name="Carl", age=25)
Now we can list and filter nodes according to the labels they are associated to:
>>> people.filter(Q("age", "gte", 30))
Installation¶
Available through Python Package Index:
$ pip install neo4jrestclient
Contents:
- neo4j-rest-client’s documentation
- Elements
- Labels
- Indices
- Queries
- Filters
- Traversals
- Extensions
- Transactions and Batch
- Options
- Changes
- 2.1.1 (2015-11-20)
- 2.1.0 (2014-11-09)
- 2.0.4 (2014-06-20)
- 2.0.3 (2014-05-16)
- 2.0.2 (2014-04-04)
- 2.0.1 (2014-03-23)
- 2.0.0 (2013-12-30)
- 1.9.0 (2013-05-27)
- 1.8.0 (2012-12-09)
- 1.7.0 (2012-05-17)
- 1.6.2 (2012-03-26)
- 1.6.1 (2012-02-27)
- 1.6.0 (2012-02-27)
- 1.5.0 (2011-10-31)
- 1.4.5 (2011-09-15)
- 1.4.4 (2011-08-17)
- 1.4.3 (2011-07-28)
- 1.4.2 (2011-07-18)
- 1.4.1 (2011-07-12)
- 1.4.0 (2011-07-11)
- 1.3.4 (2011-06-22)
- 1.3.3 (2011-06-14)
- 1.3.2 (2011-05-30)
- 1.3.1 (2011-04-16)
- 1.3.0 (2011-04-15)