Skip to main content

Flask extension for ArangoDB using python-arango

Project description

This is Flask extension for integration ArangoDB using python-arango. It’s inspired by Flask-Arango, an extension for the pyArango library.

Usage

Install using pip:

pip install flask-arangodb

Example

Typical usage looks like this:

from flask import Flask

from flask_arangodb import ArangoDB

# Configuration
ARANGO_SETTINGS = {'host': 'localhost', 'port': 8529}
ARANGO_DB = 'mydatabase'

app = Flask(__name__)
app.config.from_object(__name__)
arango = ArangoDB(app)

@app.route('/')
def index():
    # refer to python-arango for more information

    # Set up some test data to query against
    arango.db.collection('students').insert_many([
        {'_key': 'Abby', 'age': 22},
        {'_key': 'John', 'age': 18},
        {'_key': 'Mary', 'age': 21}
    ])

    # Execute the query
    cursor = db.aql.execute(
        'FOR s IN students FILTER s.age < @value RETURN s',
        bind_vars={'value': 19}
    )

    # Iterate through the result cursor
    return([student['_key'] for student in cursor])

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Filename, size & hash SHA256 hash help File type Python version Upload date
Flask_Arangodb-1.0.4-py3-none-any.whl (5.8 kB) Copy SHA256 hash SHA256 Wheel py3 Sep 10, 2016
Flask-Arangodb-1.0.4.tar.gz (3.2 kB) Copy SHA256 hash SHA256 Source None Sep 10, 2016

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN SignalFx SignalFx Supporter DigiCert DigiCert EV certificate StatusPage StatusPage Status page