Skip to main content

aioelasticsearch-py wrapper for asyncio

Project description

info:

aioelasticsearch-py wrapper for asyncio

https://img.shields.io/travis/wikibusiness/aioelasticsearch.svg https://img.shields.io/pypi/v/aioelasticsearch.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 scroll in scan:
                for doc in scroll:
                    print(doc['_source'])

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

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

aioelasticsearch-0.1.4.tar.gz (9.0 kB view details)

Uploaded Source

File details

Details for the file aioelasticsearch-0.1.4.tar.gz.

File metadata

File hashes

Hashes for aioelasticsearch-0.1.4.tar.gz
Algorithm Hash digest
SHA256 7c98c19a6ab80bb45accace1a42ce31c582d2cf827b27f871451770e670e43ef
MD5 508ddf356664e6ab8ec743bc0ebd1453
BLAKE2b-256 714344f219f3e74b5c3984113f9c394492e4046a8dc49933265e9e9b8f6a5828

See more details on using hashes here.

Supported by

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