Welcome to AutoDict’s documentation!¶
AutoDict is a Python dictionary that automatically adds children dictionaries as necessary. JSONAutoDict wraps a file and AutoDict to automatically save when exiting a context. Files use json based serialization and deserialization.
The latest version is AutoDict 1.1.0, released 2021-10-22. It is supported on:
Python versions 3.7 through 3.10.
Classes¶
Dictionary that automatically adds children dictionaries as necessary
- class AutoDict¶
Bases:
dictDictionary that automatically adds children dictionaries as necessary
- contains(*keys: object) bool¶
Check for the presence of keys in dictionary
Supply multiple keys to check children. Only descends other AutoDicts
contains(“level0”, “level1”, key) will return True when AutoDict is structured as follows: {“level0”: {“level1”: {“key”: _ }}}
- Parameters
keys – one or more keys to check for (cascading levels)
- Returns
True when key(s) exist