Skip to main content

Elasticsearch integration with asyncio.

Project description

aioes is a asyncio compatible library for working with ElasticSearch

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())

Requirements

License

aioes is offered under the BSD license.

CHANGES

0.1.0 (XXXX-XX-XX)

  • Initial release

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

aioes-0.1.0.tar.gz (23.1 kB view hashes)

Uploaded Source

Built Distribution

aioes-0.1.0-py3-none-any.whl (29.2 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page