Public API Reference

This section documents all classes and exceptions that are part of the stable public API of ndict-tools. Everything listed here is exported from the top-level ndict_tools package and covered by the project’s stability guarantees.

from ndict_tools import NestedDictionary, PathsView, CompactPathsView
from ndict_tools import StackedDictionaryError  # and subclasses

Dictionary classes

ndict_tools.NestedDictionary(*args, **kwargs)

Nested dictionary class.

ndict_tools.StrictNestedDictionary(*args, ...)

Strict nested dictionary class.

ndict_tools.SmoothNestedDictionary(*args, ...)

Smooth nested dictionary class.

Path views

ndict_tools.PathsView([stacked_dict])

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

ndict_tools.CompactPathsView([stacked_dict])

A view providing compact representation of hierarchical paths.

Exceptions

ndict_tools.StackedDictionaryError([...])

Base exception class for all stacked dictionary errors.

ndict_tools.NestedDictionaryException([...])

General exception for nested dictionary operations.

ndict_tools.StackedKeyError([message, key, path])

Exception raised when a key operation fails in a stacked dictionary.

ndict_tools.StackedAttributeError([message, ...])

Exception raised when an attribute operation fails in a stacked dictionary.

ndict_tools.StackedTypeError([message, ...])

Exception raised when a type error occurs in a stacked dictionary operation.

ndict_tools.StackedValueError([message, ...])

Exception raised when a value error occurs in a stacked dictionary operation.

ndict_tools.StackedIndexError([message, path])

Exception raised when an index error occurs in a stacked dictionary operation.