Python module for working with elasticsearch, create queries and connections
Project description
elasticsearch-tools
Made with official Python client for Elasticsearch, elasticsearch-py
Features
- Translating basic Python data types to and from JSON
- Configurable automatic discovery of cluster nodes
- Persistent connections
- Load balancing (with pluggable selection strategy) across available nodes
- Failed connection penalization (time based - failed connections won't be retried until a timeout is reached)
- Support for TLS and HTTP authentication
- Thread safety across requests
- Pluggable architecture
- Helper functions for idiomatically using APIs together
- Native connection object for sync and async sessions
- Connection object for dependency in Fastapi, or async generators
- Helper functions for query writing from code
Usage elasticsearch-py
- Creating an index
- Indexing a document
- Getting documents
- Searching documents
- Updating documents
- Deleting documents
- Deleting an index
Environment variables:
- field_pattern - regex for validate field, if you need
- default_nested_path - path for nested fields, if dont add to args to init
Query types
| Class object | name for generate_query | Official |
|---|---|---|
| ElasticQueryString | query_string | yes |
| ElasticTermQuery | term | yes |
| ElasticFuzzyQuery | fuzzy | yes |
| ElasticExistsQuery | exists | yes |
| ElasticFullMatchQuery | match_phrase | yes |
| ElasticMatchQuery | match | yes |
| ElasticRangeQuery | range | yes |
| ElasticGeoPointRangeQuery | geo_point_range | yes |
| ElasticGeoPointQuery | geo_point | no |
| ElasticNestedQuery | nested | yes |
Official documentation
Documentation for the client is available on elastic.co and Read the Docs.
License
This software is licensed under the Apache License 2.0. See NOTICE.
Deploy
Update dist
python3.9 setup.py sdist
Upload dist
twine upload dist/*
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
elasticsearch_tools-1.0.8.tar.gz
(13.3 kB
view details)
File details
Details for the file elasticsearch_tools-1.0.8.tar.gz.
File metadata
- Download URL: elasticsearch_tools-1.0.8.tar.gz
- Upload date:
- Size: 13.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.0.1 CPython/3.9.21
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
bb5a21cab5040ae916ae84fb8b4ca8120c571c2d6eaab538c44832e565d997d9
|
|
| MD5 |
5f86f1e1700db908ada6e9f846ebfcb4
|
|
| BLAKE2b-256 |
a7bcb6f1e8fa96ec4c76ce3debc9c5fd29da0c47fb611f6e16526ef7005d0e67
|