Internal API Reference

Warning

This section documents private implementation classes (underscore-prefixed). They are intended for developers who extend or maintain the package.

Internal APIs are subject to change without notice between any two releases and are not covered by the project’s stability guarantees. Do not rely on them in production code.

tools module

ndict_tools.tools.compare_dict(d1, d2)

Recursively compare two potentially nested structures for equality.

ndict_tools.tools.unpack_items(dictionary)

Recursively flatten a nested dictionary into (path, value) pairs.

ndict_tools.tools._HKey(key[, parent, is_root])

Private tree node representing a hierarchical key in a nested dictionary.

ndict_tools.tools._StackedDict(*args, **kwargs)

Internal base class for hierarchical nested dictionary structures.

ndict_tools.tools._Paths([stacked_dict])

A lazy view providing access to all hierarchical paths in a nested dictionary.

ndict_tools.tools._CPaths([stacked_dict])

A lazy view providing compact representation of hierarchical paths.

serialize module

ndict_tools.serialize._encode_key(key)

Encode a _StackedDict key to a JSON-safe string.

ndict_tools.serialize._decode_key(encoded)

Decode an encoded JSON key back to its original Python type.

ndict_tools.serialize.NestedDictionaryEncoder(*)

JSON encoder for _StackedDict instances.

ndict_tools.serialize._make_decoder_hook(...)

Return an object_pairs_hook that reconstructs a _StackedDict (or subclass) from JSON key-value pairs.

ndict_tools.serialize._pickle_dump(nd, path)

Write a _StackedDict to a pickle file with a SHA-256 sidecar.

ndict_tools.serialize._pickle_load(path[, ...])

Load a _StackedDict from a pickle file, optionally verifying its SHA-256 sidecar.