Skip to main content

Python client for INFINI Easysearch

Project description

Official Python client for INFINI Easysearch. Its goal is to provide common ground for all Easysearch-related code in Python; because of this it tries to be opinion-free and very extendable.

Installation

Install the easysearch package with pip:

$ pip install easysearch

If your application uses async/await in Python you can install with the async extra:

$ pip install "easysearch[async]"

Alternatively, you can download and install the latest version directly from the GitHub Releases page.

Compatibility

The library is currently in the 0.x release series and is compatible with INFINI Easysearch.

The recommended way to set your requirements in your setup.py or requirements.txt is to pin the version to ensure stability. For example:

easysearch>=0.1.0

Example use

Simple use-case:

>>> from datetime import datetime
>>> from easysearch import Easysearch

# by default we connect to localhost:9200
>>> es = Easysearch()

# create an index in easysearch, ignore status code 400 (index already exists)
>>> es.indices.create(index='my-index', ignore=400)
{'acknowledged': True, 'shards_acknowledged': True, 'index': 'my-index'}

# datetimes will be serialized
>>> es.index(index="my-index", id=42, body={"any": "data", "timestamp": datetime.now()})
{'_index': 'my-index',
 '_type': '_doc',
 '_id': '42',
 '_version': 1,
 'result': 'created',
 '_shards': {'total': 2, 'successful': 1, 'failed': 0},
 '_seq_no': 0,
 '_primary_term': 1}

# but not deserialized
>>> es.get(index="my-index", id=42)['_source']
{'any': 'data', 'timestamp': '2019-05-17T17:28:10.329598'}

Full documentation.

Using SSL Context with a self-signed cert use-case:

>>> from easysearch import Easysearch
>>> from ssl import create_default_context

>>> context = create_default_context(cafile="path/to/cafile.pem")
>>> es = Easysearch("https://easysearch.url:port", ssl_context=context, http_auth=('admin','password'))
>>> es.info()

Features

The client’s features include:

  • translating basic Python data types to and from json (datetimes are not decoded for performance reasons)

  • configurable automatic discovery of cluster nodes

  • persistent connections

  • load balancing (with pluggable selection strategy) across all available nodes

  • failed connection penalization (time based - failed connections won’t be retried until a timeout is reached)

  • support for ssl and http authentication

  • thread safety

  • pluggable architecture

License

Copyright 2021-2026 INFINI Labs

Licensed under the Apache License, Version 2.0 (the “License”); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an “AS IS” BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

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

easysearch-0.2.0.tar.gz (150.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

easysearch-0.2.0-py2.py3-none-any.whl (201.8 kB view details)

Uploaded Python 2Python 3

File details

Details for the file easysearch-0.2.0.tar.gz.

File metadata

  • Download URL: easysearch-0.2.0.tar.gz
  • Upload date:
  • Size: 150.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for easysearch-0.2.0.tar.gz
Algorithm Hash digest
SHA256 0a6b29724959cc9ab379d77fe9cbb4c9d998e7945216a8d6de3319e187f1b866
MD5 abaef00b4e2939fa95d5ded92861fbea
BLAKE2b-256 5f4f3f5d2ceab560d346a6804b0f7258505785dc65e6cf2782c630aa814a22c1

See more details on using hashes here.

Provenance

The following attestation bundles were made for easysearch-0.2.0.tar.gz:

Publisher: publish-easysearch-py.yml on infinilabs/ci

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file easysearch-0.2.0-py2.py3-none-any.whl.

File metadata

  • Download URL: easysearch-0.2.0-py2.py3-none-any.whl
  • Upload date:
  • Size: 201.8 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for easysearch-0.2.0-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 3882f002956d940ab4c4daf510fda57faad4b76f70bec770bb6ff7f42b447ae8
MD5 65c94df47f197175fd81e0ac505ccca9
BLAKE2b-256 1a29f22b412cfe8ac163ac8d302b6a5834b8ed5038d7ad46077a0b5be37b3f62

See more details on using hashes here.

Provenance

The following attestation bundles were made for easysearch-0.2.0-py2.py3-none-any.whl:

Publisher: publish-easysearch-py.yml on infinilabs/ci

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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