A python port of the NPM Bodybuilder Package
Project description
bodybuilder
An (almost!) drop in replacement in python of the Elasticsearch Bodybuilder Package on NPM
The API has been designed to be as close to the original package.
Also, you can use https://bodybuilder.js.org/ to test your constructions with minor changes described below:
Variations
from
->from_
becausefrom
is a python keyword- need
\
new-line indicator for multi line incantations in python which is not necessary in JS - individual Filter/Query/Aggregations classes not implemented (shouldn't affect user)
- lambda functions instead of anonymous functions (Duh!)
Installation
Install from source
- Clone package locally
- Go to the root directory
python3 setup.py install
Usage
from bodybuilder.builder import BodyBuilder as bodyBuilder
bodyBuilder().query("a", "b", "c").build()
{'query': {'a': {'b': 'c'}}}
Not Implemented
To be implemented
- minimum_should_match query and filter
- aggregation metadata
No plans to implement
- Complicated multi sort
clone
method (users can usecopy.deepcopy()
if required)orQuery
,andQuery
,notQuery
which has been deprecated n favor ofbool
method
Credits
Thanks to Danpaz and contributors of the original package for the original package from which I have liberally copied (with his permission!)
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
bodybuilder-0.1.0.tar.gz
(6.0 kB
view hashes)
Built Distribution
Close
Hashes for bodybuilder-0.1.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 84a8e6b67c33e9bef732fa0e9fb1b7bf734826cb6dbf5c36f5bb6db4cac96932 |
|
MD5 | f1feecd216978a66523a46773f144176 |
|
BLAKE2b-256 | bc14432048d4ed0ccbb295ed1d34528774197d55c0b21f1e80b83a47b581d029 |