jsonpath-python icon indicating copy to clipboard operation
jsonpath-python copied to clipboard

[FEAT] Update Function

Open mahmoudajawad opened this issue 4 years ago • 0 comments

Thank you for your work.

I liked your clean implementation of JSONPath. all other python libs seem to over do things in a style I don't like, so I settled to using yours. However, I need an update functionality in it, such as, updating a JSON-structured object using JSONPath supplied by a function to update the value dynamically for all matches. I already started working on it, however, I wanted to hear from you first on whether you have this planned already and that I work on it according to your plan, or that it is not planned and I can bring my own implementation whatever seems to work for me. I'm thinking of following API:

JSONParse(jsonpath).update(json_object, lambda current_value: 15) # Update all matches to 15

mahmoudajawad avatar Mar 10 '22 06:03 mahmoudajawad