A lightweight wrapper to operate on nested dictionaries seamlessly. 👌
The version 0.4.1 of Scalpl includes the following changes:
setdefault
did not create missing keys during the dictionary traversal (https://github.com/ducdetronquito/scalpl/issues/22)__repr__
to nicely display the proxied dictionary in a python shellThe version 0.4.0 of Scalpl includes the following changes:
Cut.pop
will raise a KeyError
exception if the key is not found and no default value has been provided.The version 0.3.0 of Scalpl includes the following changes:
LightCut
class. To keep the same behavior in your codebase, just replace the LightCut
class by the Cut
class.proxy = Cut(data)
proxy["trainers.Ash.pokemons[42].name"] = "Charmander"
> IndexError: Cannot access index '42' in path 'trainers.Ash.pokemons[42].name', because of error: IndexError('list index out of range',).
proxy["trainers.Giovanni"]
> KeyError: Cannot access key 'Giovanni' in path 'trainers.Giovanni', because of error: KeyError('Giovanni',).
Cut
class