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.

Source Distribution

Flask-Arangodb-1.0.4.tar.gz (3.2 kB view details)

Uploaded Source

Built Distribution

Flask_Arangodb-1.0.4-py3-none-any.whl (5.8 kB view details)

Uploaded Python 3

File details

Details for the file Flask-Arangodb-1.0.4.tar.gz.

File metadata

File hashes

Hashes for Flask-Arangodb-1.0.4.tar.gz
Algorithm Hash digest
SHA256 d331d5ec98ac4d92456e1a49176ee0c6149a470a18effc9b76e70ad6185a62da
MD5 2d8d19c960a8a07c9dd089776e4368b2
BLAKE2b-256 3916d3dba3a132f146c709bc33dd5d9e62ae864a4c6871aa48011e02c08de6a2

See more details on using hashes here.

File details

Details for the file Flask_Arangodb-1.0.4-py3-none-any.whl.

File metadata

File hashes

Hashes for Flask_Arangodb-1.0.4-py3-none-any.whl
Algorithm Hash digest
SHA256 fa1ccdeedeeebfe8028198e572896f99844b87852f0b23f14f3a2fd0975485ba
MD5 7111211734266b9ba410978a6c755d2f
BLAKE2b-256 d43cba09338321f5521410ac6ebc8e4f71f31101e9285281ca0ea0114f82ab24

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page