Skip to content
/ py2neo Public

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.

License

Notifications You must be signed in to change notification settings

sirmmo/py2neo

Repository files navigation

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

---

About

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.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published