A Flask extension that provides simple interaction with the Neo4j graph database.
The underlying Neo4j capabilities are made possible by the fine py2neo library.
Using pip:
pip install flask-neo4j
Typical usage looks like this:
from flask import Flask from flask.ext.neo4j import Neo4j from py2neo import Node,Relationship # Configuration GRAPH_DATABASE='http://localhost:7474/db/data/' GRAPH_USER = 'neo4j' GRAPH_PASSWORD = 'admin' app = Flask(__name__) app.config.from_object(__name__) graph_indexes = {'Species': Node} flask4j = Neo4j(app, graph_indexes).gdb print flask4j.neo4j_version nosferatu = Node('species',full_name='Dracula nosferatu',species_name='nosferatu') genus = Node('genus',name='Dracula') nosferatu_memberof_genus = Relationship(nosferatu,'Member-of',genus) flask4j.create(nosferatu_memberof_genus) # which all results in a graph that looks like: # (species)-[:MEMBER_OF]->(genus)