Skip to content

tjtimer/aio_arango

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

aio_arango

Async Python driver for ArangoDB

Read the docs here!

Getting Started

Installation

pip install -e git+https://github.com/tjtimer/aio_arango#egg=aio_arango

Usage

create a database:

from aio_arango.client import ArangoAdmin

async def setup():
    async with ArangoAdmin('me', 'mypassword') as admin:
        await admin.create_db('mydb')

create a collection and add some documents:

from aio_arango.db import ArangoDB

async def run():
    async with ArangoDB('me', 'mypassword', 'mydb') as db:
        await db.create_collection('collection1')
        await db.collection1.add({'name': 'Jane'})
        await db.collection1.add({'name': 'John'})
        await db.collection1.add({'name': 'Karl', 'age': 42})

        # or add a list of documents
        await db.collection1.add([{'name': 'Anna'}, {'name': 'Jacky', 'email': 'jacky@swag.com'}])