Skip to main content

A python package that provides GraphQL API for Elasticsearch and makes it easier to query data without writing complex queries.

Project description

esq

Build Status [pypi] Documentation Status

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 usage documentation here

History

1.0.3 (10-10-2022)

  • Added full usage detailed documentation.

1.0.2 (04-09-2022)

  • Add Github Actions workflow for version bumping and release to PyPI.

1.0.1 (30-08-2022)

  • Fix Docs and add content README.

1.0.0 (30-08-2022)

  • First release on PyPI.

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

esq-1.0.3.tar.gz (11.9 kB view details)

Uploaded Source

Built Distribution

esq-1.0.3-py2.py3-none-any.whl (5.7 kB view details)

Uploaded Python 2 Python 3

File details

Details for the file esq-1.0.3.tar.gz.

File metadata

  • Download URL: esq-1.0.3.tar.gz
  • Upload date:
  • Size: 11.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.9.14

File hashes

Hashes for esq-1.0.3.tar.gz
Algorithm Hash digest
SHA256 95d4c8079320f5d6943b1139af8a6fe787ae956c019e04ba3a313f6f230a798d
MD5 a6e26c31f5a3ff6fa77dac18b6e8156c
BLAKE2b-256 c8e0f670f984daf8545a1c7dbe7a467568268150404ce4249a1a1fb2cf8f3a0f

See more details on using hashes here.

File details

Details for the file esq-1.0.3-py2.py3-none-any.whl.

File metadata

  • Download URL: esq-1.0.3-py2.py3-none-any.whl
  • Upload date:
  • Size: 5.7 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.9.14

File hashes

Hashes for esq-1.0.3-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 25bdf0cb150400edd9bf6d59ebc88f6f9bfee27af5491a29b538af59848c1c68
MD5 827ccc8afc3a4b007c4002ba21a758a9
BLAKE2b-256 d788db07a8dd34f49f8b74221dfad4950acc6d40bbda11aeda6823c35da0a9e2

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page