- This utility helps retreiving search key from the nested python object
- Clone this repository
git clone https://github.com/sumitroy2611/key_search
- Open the repository on your instance
cd key_search
- Open the
src
foldercd key_search/src
- Run whichever script you need:
python3 key_search.py
This prompts with following messages:Please enter the json object to be parsed:
Please enter the key to be searched in the object:
- It makes use of recursion to slice the search key that is already matched with the object key and send the remaining search keys for further round of iteration until all the keys are search and final value is attained
- Unit tests has been written in tests/tests.py and is executed using python unittest module.
- To run the tests following command needs to be executed from the root folder: - python3 -m unittest