emehrkay / neoasynchttpy

Super simple async HTTP client for Neo4j

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

neoasynchttpy

A simple async package for Neo4j HTTP.

Installation

python setup.py install

Usage

All requests are async and utilize the package aiohttp so they must be executed within an ioloop.

import asyncio
import random

from neoasynchttpy.connection import Connection


conn = Connection(url='localhost', username='neo4j', password='somepassword')

async def example():
    script = "CREATE (n {props}) RETURN n"
    params = {
        'props': {
            'name': 'mark'+ str(random.random())
        }
    }
    conn.statement(statement=script, parameters=params)
    resp = await conn.query()
    print(resp.results)


asyncio.get_event_loop().run_until_complete(example())

About

Super simple async HTTP client for Neo4j

License:MIT License


Languages

Language:Python 100.0%