update

raw JSON →
0.0.1 verified Mon Apr 27 auth: no python

A Python utility library for updating nested data structures (dicts, lists) with dot-notation path support. Current version: 0.0.1, pre-1.0, early stage.

pip install update
error AttributeError: module 'update' has no attribute 'update'
cause Importing the module instead of the function.
fix
Use 'from update import update' then call update(data, path, value).
gotcha Library is pre-1.0 (0.0.1), API may change without notice.
fix Pin exact version in requirements.
gotcha The update function mutates the input dict in-place; no deep copy is made.
fix Use copy.deepcopy() if you need to preserve original.

Update nested dict value using dot-separated path.

from update import update

data = {'a': {'b': 1}}
update(data, 'a.b', 2)
print(data)  # {'a': {'b': 2}}