Skip to main content

elasticsearch-py wrapper for asyncio

Project description

info:elasticsearch-py wrapper for asyncio
https://img.shields.io/travis/aio-libs/aioelasticsearch.svg https://img.shields.io/pypi/v/aioelasticsearch.svg https://codecov.io/gh/aio-libs/aioelasticsearch/branch/master/graph/badge.svg

Installation

pip install aioelasticsearch

Usage

import asyncio

from aioelasticsearch import Elasticsearch

async def go():
    es = Elasticsearch()

    print(await es.search())

    await es.close()

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

Features

Asynchronous scroll

import asyncio

from aioelasticsearch import Elasticsearch
from aioelasticsearch.helpers import Scan

async def go():
    async with Elasticsearch() as es:
        async with Scan(
            es,
            index='index',
            doc_type='doc_type',
            query={},
        ) as scan:
            print(scan.total)

            async for doc in scan:
                print(doc['_source'])

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

Thanks

The library was donated by Ocean S.A.

Thanks to the company for contribution.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for aioelasticsearch, version 0.7.0
Filename, size File type Python version Upload date Hashes
Filename, size aioelasticsearch-0.7.0-py3-none-any.whl (11.0 kB) File type Wheel Python version py3 Upload date Hashes View
Filename, size aioelasticsearch-0.7.0.tar.gz (10.0 kB) File type Source Python version None Upload date Hashes View

Supported by

Pingdom Pingdom Monitoring Google Google Object Storage and Download Analytics Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page