Interactive Playground¶
Try the nestedutils library directly in your browser! This page uses Pyodide to run Python in the browser.
Loading Pyodide...
Installed:
nestedutils
Data
Depth
-
Leaves
-
Get Value
Retrieve a value from the nested data structure using dot notation.
Use dot notation. For arrays: items.0.title
If omitted and path doesn't exist, raises PathError
Python Code
get_at(data, "path")
Set Value
Set a value in the nested data structure at the specified path.
Python Code
set_at(data, "path", value, create=True)
Check Existence
Check if a path exists in the nested data structure.
Python Code
exists_at(data, "path")
Delete Value
Delete a value from the nested data structure.
Python Code
delete_at(data, "path")
Get Depth
Get the maximum nesting depth of your data structure.
Python Code
get_depth(data)
Count Leaves
Count the total number of leaf values (non-container values) in your data.
Python Code
count_leaves(data)
Get All Paths
Get all paths to leaf values in your data structure.
Python Code
get_all_paths(data)