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:

$ python -m pip install easysearch

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

$ python -m pip install easysearch[async]

Read more about how to use asyncio with this project.

Compatibility

The library is compatible with Easysearch 1.x and 2.x versions.

For Easysearch 1.x, use the major version 1 (1.x.y) of the library.

For Easysearch 2.x, use the major version 2 (2.x.y) of the library.

The recommended way to set your requirements in your setup.py or requirements.txt is:

# Easysearch 2.x
easysearch>=2.0.0,<3.0.0

# Easysearch 1.x
easysearch>=1.0.0,<2.0.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.1.0.tar.gz (148.8 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.1.0-py2.py3-none-any.whl (193.9 kB view details)

Uploaded Python 2Python 3

File details

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

File metadata

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

File hashes

Hashes for easysearch-0.1.0.tar.gz
Algorithm Hash digest
SHA256 2036f5fca51b48bfe0c3bfc8a773e4313a9620cdd20e85f86bc265c0ff74836f
MD5 4b9d553ed3d9b2588073a143a0c5bc3a
BLAKE2b-256 cc9ed333ec66e71ce61d46c4cb82a717fbc394a733cd2a2c199941c0ed8166f7

See more details on using hashes here.

Provenance

The following attestation bundles were made for easysearch-0.1.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.1.0-py2.py3-none-any.whl.

File metadata

  • Download URL: easysearch-0.1.0-py2.py3-none-any.whl
  • Upload date:
  • Size: 193.9 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.1.0-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 385e7e1e362018d1929c87c1c3dcfc74cc0232eb23e1d4221f3f0e7b0804231b
MD5 b036e1c844cfcbe4e240eadf822c5048
BLAKE2b-256 e021e23884cc398120a23ab65da513f8db0e3a6e632f6524001d7dc72a8bd1cd

See more details on using hashes here.

Provenance

The following attestation bundles were made for easysearch-0.1.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