In `dictquery` I use simple and easy to understand language.
BUT My project is exercise and it is obviously not a competitor to mature, community supported libs.
That is why i do not want to compare `dictquery` to other libs
18 karma · joined February 12, 2018
In `dictquery` I use simple and easy to understand language.
BUT My project is exercise and it is obviously not a competitor to mature, community supported libs.
That is why i do not want to compare `dictquery` to other libs
If I need to check my dictionary I want to use something similar to natural language.
lambdas and filters are greate, but not obvious at a glance.
If I want to check my dict: "Username is 'john' and age is greater than 23"
I will make this query: "`username` == 'john' and `age` > 23"
This query is obvious (i hope it is) for anyone from first glance
def get_dict_value(query_dict, dict_key, use_nested_keys=True,
key_separator='.', raise_keyerror=False):
theoretically i can make alternative syntax.The plus of "stringly API" is that you can save your queries in database, or get it through web interface
As exercise I implemented a library to query dicts.
This is my first python library and I'm looking for feedback and criticism
Especially, I need advice about public API
https://github.com/cyberlis/dictquery
You can install it with:
pip install dictquery
To write it I read:
Python Cookbook third edition. 2.18 Tokenizing Text, 2.19 Writing a Simple Recursive Descent Parser
All parsing related articles from https://eli.thegreenplace.net/2010/01/02/top-down-operator-p...
https://docs.python.org/3/library/re.html#writing-a-tokenize...