跳转到主要内容

与asyncio集成的Elasticsearch。

项目描述

aioes 是一个兼容 asyncio 的库,用于处理 Elasticsearch

https://travis-ci.org/aio-libs/aioes.svg?branch=master https://codecov.io/gh/aio-libs/aioes/branch/master/graph/badge.svg

文档

在 Read The Docs 上阅读 aioes 文档:http://aioes.readthedocs.io/

示例

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

要求

测试

在执行测试之前,请确保Elasticsearch实例正在端口9200上运行。

为了使所有测试工作,您需要在 config/elasticsearch.yml 配置文件中添加以下行

启用Groovy脚本

script.groovy.sandbox.enabled: true

设置存储库路径

path.repo: ["/tmp"]

测试套件使用 py.test,只需运行

$ py.test

许可证

aioes 在BSD许可证下提供。

变更

0.7.2 (2017-04-19)

  • Transport 中允许自定义 Connector:#138,#137。

  • 修复了文档中的几个错别字。

0.7.0 (2017-03-29)

  • 修复Elasticsearch 5.x兼容性问题:#48,#72,#112,#73,#123。

  • stored_fields添加到mgetsearchexplain方法(#123)。

  • health中添加wait_for_no_relocating_shards参数(#123)。

  • analyze中添加filtertoken_filterchar_filter参数(#123)。

  • 添加force_merge方法(重命名为optimize)(#123)。

  • 在hot_threads中添加ignore_idle_threads参数(#123)。

  • 更新项目依赖。

  • 将测试转换为pytest。

0.6.1 (2016-09-08)

  • 接受字节作为负载(#42)。

  • Elasticsearch.close()转换为协程。

0.6.0 (2016-09-08)

  • 添加对verify_ssl的支持(#43)。

0.5.0 (2016-07-16)

  • 在连接中允许使用scheme,用户名和密码(#40)。

0.4.0 (2016-02-10)

  • 修复ES2+兼容性问题中的传输地址正则表达式(#38)。

0.3.0 (2016-01-27)

  • 在内部使用aiohttp.ClientSession(#36)。

0.2.0 (2015-10-08)

  • 与Elasticsearch 1.7兼容。

  • 支持Python 3.5。

  • 放弃对Python 3.3的支持。

  • 在Apache 2下重新许可。

0.1.0 (2014-10-04)

  • 初始发布。

项目详情。


下载文件。

下载您平台的文件。如果您不确定选择哪个,请了解更多关于安装包的信息。

源分布。

aioes-0.7.2.tar.gz (65.2 kB 查看散列)

上传时间

构建分布。

aioes-0.7.2-py3-none-any.whl (31.7 kB 查看散列)

上传时间 Python 3

由以下机构支持

AWS AWS 云计算和安全赞助商 Datadog Datadog 监控 Fastly Fastly CDN Google Google 下载分析 Microsoft Microsoft PSF 赞助商 Pingdom Pingdom 监控 Sentry Sentry 错误记录 StatusPage StatusPage 状态页面