与asyncio集成的Elasticsearch。
项目描述
aioes 是一个兼容 asyncio 的库,用于处理 Elasticsearch
文档
在 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添加到mget,search和explain方法(#123)。 
- 在health中添加wait_for_no_relocating_shards参数(#123)。 
- 在analyze中添加filter,token_filter,char_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的散列
| 算法 | 散列摘要 | |
|---|---|---|
| SHA256 | 02f8eacd21086baa5f888d36333edaa685cad3f10f7b7967f1af119a5d0ce84b | |
| MD5 | 2e5806919e8768ec7a659448b92c98d1 | |
| BLAKE2b-256 | 80ccd762ea050bf263a327a9d9882cb0a8f781eab3367f9e6f3b6288964599d8 | 
aioes-0.7.2-py3-none-any.whl的散列
| 算法 | 散列摘要 | |
|---|---|---|
| SHA256 | d9e56609db4188d666fa7b0956be97873699528c445aeb2c252464b8775c8eab | |
| MD5 | fc3bb661874ba558f65efe4535298f19 | |
| BLAKE2b-256 | 58298010326aac2aaf565e13658d3e8f499ba4d5e3750c994f6554c479f9201c |