The API response goes five levels deep. Your code goes five lines wide.
You need one field. Maybe it lives under users, then the first item, then profile, then name. You start chaining checks. Each missing key is another branch. The readable logic disappears into guards.
nestedutils keeps plain dicts and lists. You pass a path like a single string and get the value, set it, or check it exists.
One path string beats a hallway of if statements.
What you get
- Read deep values without a guard script. Pull a field from nested dicts and lists with a dot path. Pass a default when the path might be missing.
- Write where the structure is not built yet. Turn on auto-creation and missing containers appear as dicts or lists while you set the value.
- Know before you dig. Ask whether a path exists before you rely on it, instead of guessing from exceptions.
- Change or remove without losing your place. Update a nested value or delete a key while the rest of the tree stays a normal Python structure.
- See the shape when JSON gets weird. Helpers report depth, leaf count, and every path so debugging messy payloads takes less guesswork.
- Free, small, and dependency-free. Pure Python, MIT licensed, on PyPI for Python 3.8 and up.
Picture your Tuesday
An illustrative case: a webhook drops a nested JSON blob on your desk. You need the customer email three levels in, and you might need to stash a new flag under settings later. One path string gets the email. Another, with create turned on, adds the flag without hand-building empty dicts first. No custom wrapper class. The data stays dicts and lists you already know.
Not writing code yet? Try it in your browser
The interactive playground runs the same helpers on sample JSON. Edit the data, switch examples, and copy the Python that matches what you tried.
Ready to try it?
- See it on GitHub for install steps and the full API
- Get it on PyPI
- Read the docs






