Permalink
Fetching contributors…
Cannot retrieve contributors at this time
87 lines (62 sloc) 2.1 KB

aioes

aioes is a library for working with an :term:`Elasticsearch` from :term:`asyncio` framework.

Features

Basic Example

import asyncio
from aioes import Elasticsearch

@asyncio.coroutine
def go():
    es = Elasticsearch(['localhost:9200'])
    ret = yield from es.create(index="my-index",
                               doc_type="test-type",
                               id=42,
                               body={"str": "data",
                                     "int": 1})
    assert (ret == {'_id': '42',
                    '_index': 'my-index',
                    '_type': 'test-type',
                    '_version': 1,
                    'ok': True})

    answer = yield from es.get(index="my-index",
                               doc_type="test-type",
                               id=42)
    assert answer['_source'] == {'str': 'data', 'int': 1}

loop = asyncio.get_event_loop()
loop.run_until_complete(go())

Installation

aioes published on PyPI and can be installed via pip tool:

pip3 install aioes

Dependencies

Authors and License

The aioes package is written by Andrew Svetlov. It's BSD licensed and freely available.

Feel free to improve this package and send a pull request to GitHub.

Contents:

.. toctree::
   :maxdepth: 2

   reference
   glossary

Indices and tables