跳转到主要内容

Elasticsearch 服务器端 Python 客户端

项目描述

https://img.shields.io/pypi/v/elasticsearch-serverless https://img.shields.io/conda/vn/conda-forge/elasticsearch-serverless?color=blue https://static.pepy.tech/badge/elasticsearch-serverless https://clients-ci.elastic.co/job/elastic+elasticsearch-serverless-python+main/badge/icon https://readthedocs.org/projects/elasticsearch-serverless-python/badge/?version=latest&style=flat

Elasticsearch Serverless的官方Python客户端。

功能

  • 将基本的Python数据类型翻译成JSON并从JSON转换回来

  • 可配置自动发现集群节点

  • 持久连接

  • 在可用节点之间进行负载均衡(具有可插拔的选择策略)

  • 失败的连接惩罚(基于时间 - 在达到超时之前不会重试失败的连接)

  • 支持TLS和HTTP身份验证

  • 请求间的线程安全

  • 可插拔架构

  • 用于共同使用API的辅助函数

安装

使用pip安装elasticsearch-serverless软件包:pip

$ python -m pip install elasticsearch-serverless

如果你的应用程序使用Python的async/await,可以使用async额外安装

$ python -m pip install elasticsearch-serverless[async]

更多关于如何使用asyncio与该项目的信息。

兼容性

待办事项

文档

客户端文档可在elastic.coRead the Docs上找到。

快速入门

# Import the client from the 'elasticsearch' module
>>> from elasticsearch_serverless import Elasticsearch

# Instantiate a client instance
>>> client = Elasticsearch("http://localhost:9200")

# Call an API, in this example `info()`
>>> resp = client.info()

# View the result
>>> resp
{
  "name" : "instance-name",
  "cluster_name" : "cluster-name",
  "cluster_uuid" : "cluster-uuid",
  "version" : {
    "number" : "7.14.0",
    ...
  },
  "tagline" : "You know, for Search"
}

你可以在文档中了解更多关于如何配置客户端的信息。

许可证

版权 2023 Elasticsearch B.V. 依据Apache许可证版本2.0授权。

项目详情


下载文件

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

源分布

elasticsearch_serverless-0.4.0.20231031.tar.gz (253.5 kB 查看哈希值)

上传时间: 源代码

构建分布

elasticsearch_serverless-0.4.0.20231031-py3-none-any.whl (315.3 kB 查看哈希值)

上传时间: Python 3

由以下赞助

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