Registry / serialization / dotwiz

dotwiz

JSON →
library0.4.0pypypi✓ verified 88d ago

DotWiz is a blazing fast dict subclass that enables accessing nested dictionary keys using dot notation. It wraps dictionaries and provides attribute-style access. Current version 0.4.0, maintained but not rapidly updated.

pip install dotwiz
INSTALL
IMPORT
SIG · DOTWIZ
D
dotwiz
serializationpythonv0.4.0
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

DotWiz
✓ from dotwiz import DotWiz
No common wrong import; use from dotwiz import DotWiz

Basic usage: create a DotWiz instance and access nested keys with dot notation.

from dotwiz import DotWiz # Create a DotWiz object d = DotWiz({'name': 'John', 'info': {'age': 30, 'city': 'NYC'}}) # Access nested keys via dot notation print(d.name) # John print(d.info.age) # 30 # Assign values d.info.city = 'Boston' print(d) # {'name': 'John', 'info': {'age': 30, 'city': 'Boston'}}
Debug
Known issues
gotchaDotWiz does not convert nested dicts passed after creation. Only nested dicts at initialization are converted. Assigning a plain dict to a key after creation will not be automatically wrapped.
fix
Manually wrap nested dicts: d.key = DotWiz({'subkey': 'value'})
affects: all
gotchaDotWiz is not a full replacement for dict. Methods like .items(), .keys() work, but some dict methods (e.g., .copy()) return a plain dict, not a DotWiz.
fix
If you need deep copy preserving DotWiz, use copy.deepcopy or wrap explicitly.
affects: all
deprecatedThe module does not explicitly deprecate any features, but be aware that version 0.4.0 may have limited future updates.
fix
Monitor the repository for any changes.
affects: 0.4.0
Errors
Common errors & fixes
AttributeError: 'dict' object has no attribute 'subkey'
A nested dict was not converted to DotWiz because it was assigned after initialization.
fix
Use d.key = DotWiz({'subkey': value}) instead of d.key = {'subkey': value}
TypeError: 'DotWiz' object is not callable
Trying to call dotwiz as a function instead of importing the class.
fix
Import the class: from dotwiz import DotWiz
KeyError: 'key'
Trying to access a key that doesn't exist using bracket notation when attribute access would raise AttributeError.
fix
Check key exists with 'key' in d or use .get() method.
Upgrade
Version history
0.4.0latest on PyPI · released Sep 21, 2022
Audit
Dependencies

No dependency data recorded yet.

Agent activity
17 hits · last 30 days
node
16
Resources
dotwiz — pip install dotwiz · libregistry