neomodel

An Object Graph Mapper (OGM) for the neo4j graph database, built on the awesome neo4j_driver

  • Familiar class based model definitions with proper inheritance.
  • Powerful query API.
  • Schema enforcement through cardinality restrictions.
  • Full transaction support.
  • Thread safe.
  • Pre/post save/delete hooks.
  • Django integration via django_neomodel

Documentation

Available on readthedocs.

Requirements

Installation

Install from pypi (recommended):

$ pip install neomodel ($ source dev # To install all things needed in a Python3 venv)

To install from github:

$ pip install git+git://github.com/neo4j-contrib/neomodel.git@HEAD#egg=neomodel-dev

Upgrading 2.x to 3.x

  • Now utilises neo4j_driver as the backend which uses bolt so neo4j 3 is required
  • Connection now set through config.DATABASE_URL (see getting started docs)
  • The deprecated category() method on StructuredNode has been removed
  • The deprecated index property on StructuredNode has been removed
  • The streaming=True flag is now irrelevant with bolt and produces a deprecation warning
  • Batch operations must now be wrapped in a transaction in order to be atomic
  • Indexing NodeSets returns a single node now as opposed to a list

GitHub

https://github.com/neo4j-contrib/neomodel