Skip to content

Flask extension providing integration with the Neo4j graph database.

License

Notifications You must be signed in to change notification settings

lashex/flask-neo4j

Repository files navigation

Flask-Neo4j

https://img.shields.io/pypi/pyversions/Flask-Neo4j.png https://secure.travis-ci.org/lashex/flask-neo4j.png https://img.shields.io/pypi/wheel/Flask-Neo4j.png

A Flask extension that provides simple interaction with the Neo4j graph database.

The underlying Neo4j capabilities are made possible by the fine py2neo library.

Installation

Using pip:

pip install flask-neo4j

Usage

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)

Links

About

Flask extension providing integration with the Neo4j graph database.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •  

Languages