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'}
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
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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0a6b29724959cc9ab379d77fe9cbb4c9d998e7945216a8d6de3319e187f1b866
|
|
| MD5 |
abaef00b4e2939fa95d5ded92861fbea
|
|
| BLAKE2b-256 |
5f4f3f5d2ceab560d346a6804b0f7258505785dc65e6cf2782c630aa814a22c1
|
Provenance
The following attestation bundles were made for easysearch-0.2.0.tar.gz:
Publisher:
publish-easysearch-py.yml on infinilabs/ci
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
easysearch-0.2.0.tar.gz -
Subject digest:
0a6b29724959cc9ab379d77fe9cbb4c9d998e7945216a8d6de3319e187f1b866 - Sigstore transparency entry: 1131292876
- Sigstore integration time:
-
Permalink:
infinilabs/ci@bb1a9dabe1e695855de8cdecb6cb1c3403e37e05 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/infinilabs
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-easysearch-py.yml@bb1a9dabe1e695855de8cdecb6cb1c3403e37e05 -
Trigger Event:
workflow_dispatch
-
Statement type:
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3882f002956d940ab4c4daf510fda57faad4b76f70bec770bb6ff7f42b447ae8
|
|
| MD5 |
65c94df47f197175fd81e0ac505ccca9
|
|
| BLAKE2b-256 |
1a29f22b412cfe8ac163ac8d302b6a5834b8ed5038d7ad46077a0b5be37b3f62
|
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
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
easysearch-0.2.0-py2.py3-none-any.whl -
Subject digest:
3882f002956d940ab4c4daf510fda57faad4b76f70bec770bb6ff7f42b447ae8 - Sigstore transparency entry: 1131293020
- Sigstore integration time:
-
Permalink:
infinilabs/ci@bb1a9dabe1e695855de8cdecb6cb1c3403e37e05 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/infinilabs
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-easysearch-py.yml@bb1a9dabe1e695855de8cdecb6cb1c3403e37e05 -
Trigger Event:
workflow_dispatch
-
Statement type: