Skip to main content

Django Querysets-esque implementation for Elasticsearch

Project description

# PyEQS [![Build Status](https://travis-ci.org/Yipit/pyeqs.svg)](https://travis-ci.org/Yipit/pyeqs) [![Coverage Status](https://coveralls.io/repos/Yipit/pyeqs/badge.png)](https://coveralls.io/r/Yipit/pyeqs)

#### Python Elasticsearch QuerySets

A python library to simplify building complex Elasticsearch JSON queries. Based on the Django QuerySet API.

## Installation

```bash
pip install pyeqs
```

## Usage

Simple querying

```python
from pyeqs import QuerySet
qs = QuerySet("http://localhost:9200", index="my_index")
print qs._query
"""
{
'query': {
'match_all': {}
}
}"""
```

Simple Filtering

```python
from pyeqs import QuerySet
from pyeqs.dsl import Term
qs = QuerySet("http://localhost:9200", index="my_index")
qs.filter(Term("foo", "bar"))
print qs._query
"""
{
'query': {
'filtered': {
'filter': {
'and': [
{
'term': {
'foo': 'bar'
}
}
]
},
'query': {
'match_all': {}
}
}
}
}"""
```

## Contributing

* Fork the `git` repo
* Download the forked `git` repo
* Create a branch for your changes
* Link the `pre-commit` hook to `.git/hooks/pre-commit`
* Run the tests, *before you make changes*, to make sure everything works
* Change the code for your PR
* Write (or modify) tests to make sure your changes work
* Submit a Pull Request

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

pyeqs-0.3.0.tar.gz (6.3 kB view hashes)

Uploaded Source

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