OneFilter

One filter for all structured data.


Keywords
Filtering, Python
License
MIT
Install
pip install OneFilter

Documentation

OneFilter

One filter for all structured data.

Getting started

>>> from onefilter import F, And, Or, Exists, Eq, Gte, Lte 
>>> from onefilter.es import ES
>>> f = F(a=Or([Exists(False), Eq(0)]), b=And([Gte(10), Lte(20)]))
>>> c = ES(f)
>>> import pprint; pprint.pprint(c)
{'bool': {'must': [{'bool': {'should': [{'must_not': {'exists': {'field': 'a'}}},
                                        {'term': {'a': 0}}]}},
                   {'range': {'b': {'gte': 10, 'lte': 20}}}]}}

License

MIT