forked from sirmmo/py2neo
-
Notifications
You must be signed in to change notification settings - Fork 0
/
README
97 lines (65 loc) · 2.35 KB
/
README
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
py2neo
=======
The py2neo project provides bindings between Python and Neo4j via its RESTful
web service interface. It attempts to be both Pythonic and consistent with the
core Neo4j API.
Website: http://py2neo.org/
Source code: https://github.com/nigelsmall/py2neo
Version 0.97
-------------
- Updated geoff.py loader to read relationship index entries
Version 0.96
-------------
- More batch operations added (see http://py2neo.org/batch for details)
- Lots of refactoring
Version 0.95
-------------
- New complete application example added: PynIT!
- Added encoding for indexes to allow slashes in values
- Added get_xxx_index to allow automatic creation of non-existant indexes
Version 0.94
-------------
- Added HTTP authentication options (user name & password)
Version 0.93
-------------
- Added GraphDatabaseService.get_subreference_node() method
- Added index entry support to GEOFF files
Version 0.92
-------------
- PersistentObject class introduced with new example file example2.py
Version 0.91
-------------
- Fixed small bug in Path class
- Added GraphDatabaseService.create_nodes() method to add a batch of nodes in
a single transaction
Version 0.9
------------
PLEASE NOTE THAT v0.9 IS NOT FULLY BACKWARD COMPATIBLE WITH v0.8 (This applies
primarily to Path and Traverser objects which are now more in-sync with Neo4j
Java API)
- Changes to method and property signatures to bring into line with Java API
- Path class renamed and changed to use properties instead of methods
- Traverser class completely rewritten and new TraversalDescription class
- Updated README and example1.py with new sample code
- Added method get_id to IndexableResource
- Added methods get_type, is_type and get_nodes to Relationship class
- Added get_single_* methods to Node class
---
#!/usr/bin/env python
"""
Simple first example showing connection and traversal
"""
# Allow the import path to access neo4j modules
import sys
sys.path.append("../src")
from py2neo import neo4j
# Attach to the graph db instance
gdb = neo4j.GraphDatabaseService("http://localhost:7474/db/data")
# Obtain a link to the reference node of the db
ref_node = gdb.get_reference_node()
# Obtain a traverser instance relative to reference node
traverser = ref_node.traverse(order="depth_first", max_depth=2)
# Output all the paths from this traversal
for path in traverser.paths:
print path
---