A python package that provides GraphQL API for Elasticsearch and makes it easier to query data without writing complex queries.
Project description
esq
Install - Init - Usage - Documentation
A python package that provides GraphQL API for Elasticsearch and makes it easier to query data without writing complex queries.
Install
pip install esq
Init
>>> from esq import Esq
>>> from elasticsearch import Elasticsearch
# init your Elasticsearch client object here
>>> ELASTICSEARCH_URI = "http://localhost:9200"
>>> es_client = Elasticsearch([ELASTICSEARCH_URI])
# init your Esq object here
>>> esq = Esq(es_client)
# now you can start making queries
Usage
# to get aggregation on sentiment field on your twitter index, you can simply do:
>>> sentiments = esq.get_aggr_data(index='twitter',
data_type='keyword/text', #data_type is an enum('keyword/text', 'coordinates', 'timeseries')
data_field='sentiment')
>>> print(sentiments)
[{'label': 'positive', 'value': 9}, {'label': 'neutral', 'value': 7}, {'label': 'negative', 'value': 1}]
Documentation
Read the full documentation here
History
1.0.1 (2022-08-30)
- Fix Docs and add content README.
1.0.0 (2022-08-30)
- First release on PyPI.
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
esq-1.0.2.tar.gz
(9.7 kB
view details)
Built Distribution
File details
Details for the file esq-1.0.2.tar.gz
.
File metadata
- Download URL: esq-1.0.2.tar.gz
- Upload date:
- Size: 9.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.9.13
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 264ca933566edc32c13e551f30c4699337ccca321dcf8228fd4f9fa57d01bdcd |
|
MD5 | c6865e34dd82bdd5c2adf0fb45310ff9 |
|
BLAKE2b-256 | bf4f99a67d5666e34fdb8d8776683c417c6aef3d8227ad7644078729427cee9e |
File details
Details for the file esq-1.0.2-py2.py3-none-any.whl
.
File metadata
- Download URL: esq-1.0.2-py2.py3-none-any.whl
- Upload date:
- Size: 5.6 kB
- Tags: Python 2, Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.9.13
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 15b8d876520ebdbddbbe3dc9522d4bc65c353c06589460c7bafd9e8064ba93aa |
|
MD5 | 21045fc0dc02c039b3f07f6c76f9561d |
|
BLAKE2b-256 | 5f246e69e7da110195c6113024059b8c7676dd6affee16cb6fef48042a0149a2 |