ArangoDB Driver for Python

Features support

Driver for Python is not entirely completed. It supports Connections to ArangoDB with custom options, Collections, Documents, Indexes Cursors and partially Edges.

Presentation about Graph Databases and Python with real-world examples how to work with arango-python.

ArangoDB is an open-source database with a flexible data model for documents, graphs, and key-values. Build high performance applications using a convenient sql-like query language or JavaScript/Ruby extensions.

More details about ArangoDB on official website. Some blog posts about this driver.

Getting started

Installation

Library is in early alpha so it’s not on PyPi yet. To install use pip:

pip install arango

Usage example

It’s quite simple to start work with ArangoDB:

from arango import create

# create connection to database
conn = create(db="test")

# create database itself
conn.database.create()

# create collection with name `test_collection`
conn.test_collection.create()
# create document
conn.test_collection.documents.create({"sample_key": "sample_value"})
# get first document
doc = conn.test_collection.documents().first
# get document body
doc.body

# get all documents in collection
for doc in conn.test_collection.query.execute():
  print doc.id

# work with AQL
conn.test_range.create()

for n in range(10):
  conn.test_range.documents.create({
    "n": n,
    "mult": n * n})

conn.test_range.query.filter(
  filter("n == 1 || n == 5")).execute()

# delete database
conn.database.delete()

Arango versions, Platforms and Python versions

Supported versions of ArangoDB: 1.1x and 1.2x

This release support Python 3.3, Python 2.7, PyPy 1.9.

Indices and tables