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 Common errors
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).
Warnings
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.
Imports
- update wrong
import updatecorrectfrom update import update
Quickstart
from update import update
data = {'a': {'b': 1}}
update(data, 'a.b', 2)
print(data) # {'a': {'b': 2}}