Skip to content

brianm1028/flask-neoalchemy

 
 

Flask-NeoAlchemy

Flask-NeoAlchemy is an extension for Flask that adds support for py2neo/Neo4J to your application. It aims to simplify using py2neo with Flask by providing useful defaults and extra helpers that make it easier to accomplish common tasks.

Installing

Install and update using pip:

$ pip install -U Flask-NeoAlchemy

A Simple Example

from flask import Flask
from flask_neoalchemy import NeoAlchemy

app = Flask(__name__)
app.config["NEO4J_DATABASE_URI"] = "bolt://neo4j:neo4j@host:7687/neo4j"
db = NeoAlchemy(app)


class User(db.Model):
    id = db.Property(db.Integer, primary_key=True)
    username = db.Property(db.String, unique=True, nullable=False)
    email = db.Property(db.String, unique=True, nullable=False)


db.session.add(User(username="Flask", email="example@example.com"))
db.session.commit()

users = User.query.all()

Contributing

For guidance on setting up a development environment and how to make a contribution to Flask-NeoAlchemy, see the contributing guidelines.

Donate

The Pallets organization develops and supports Flask-NeoAlchemy. In order to grow the community of contributors and users, and allow the maintainers to devote more time to the projects, please donate today.

Packages

No packages published

Languages

  • Python 100.0%