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])
Links
[python-arango documentation](http://python-driver-for-arangodb.readthedocs.io/en/master/intro.html)
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)
Built Distribution
File details
Details for the file Flask-Arangodb-1.0.4.tar.gz
.
File metadata
- Download URL: Flask-Arangodb-1.0.4.tar.gz
- Upload date:
- Size: 3.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | d331d5ec98ac4d92456e1a49176ee0c6149a470a18effc9b76e70ad6185a62da |
|
MD5 | 2d8d19c960a8a07c9dd089776e4368b2 |
|
BLAKE2b-256 | 3916d3dba3a132f146c709bc33dd5d9e62ae864a4c6871aa48011e02c08de6a2 |
File details
Details for the file Flask_Arangodb-1.0.4-py3-none-any.whl
.
File metadata
- Download URL: Flask_Arangodb-1.0.4-py3-none-any.whl
- Upload date:
- Size: 5.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | fa1ccdeedeeebfe8028198e572896f99844b87852f0b23f14f3a2fd0975485ba |
|
MD5 | 7111211734266b9ba410978a6c755d2f |
|
BLAKE2b-256 | d43cba09338321f5521410ac6ebc8e4f71f31101e9285281ca0ea0114f82ab24 |