Registry / serialization / ndicts

ndicts

JSON →
library0.3.0pypypi✓ verified 83d ago

ndicts provides a nested dictionary class (ndict) that supports dot-notation access and manipulation of nested structures. Version 0.3.0 is the latest, targeting Python 3.8+. Release cadence is sporadic.

pip install ndicts
INSTALL
IMPORT
SIG · NDICTS
N
ndicts
serializationpythonv0.3.0
Install
1.6s avg
Import
25ms
Disk
16MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v0.3.0 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.103.95 runs
installs and imports cleanly · install 0.0s · import 0.028s · 18.2MB
glibc
py 3.103.95 runs
installs and imports cleanly · install 1.6s · import 0.022s · 19MB
16MB installed
● package 16MB
Code
Verified usage

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

NestedDict
from ndicts import NestedDict
from ndicts.ndict import NestedDict
Wrong submodule path; NestedDict is exported from the top-level package.

Create a NestedDict, access and set values with dot-notation keys, and convert back to a plain dict.

from ndicts import NestedDict nd = NestedDict({'a': {'b': 1}}) print(nd['a.b']) # access via dot notation nd['a.c'] = 2 print(nd.to_dict())
Debug
Known issues
gotchaDot notation keys like 'a.b' will be split on dots. If your actual keys contain dots, use a different delimiter or avoid dot-notation access.
fix
Use bracket access with tuple keys or set a custom delimiter via NestedDict(delimiter='|').
affects: all
gotchaNestedDict does not preserve insertion order in Python <3.7 (though Python 3.8+ does). Relying on order may break in older Python versions if backporting.
fix
Use Python 3.7+ or wrap in OrderedDict if necessary.
affects: all
Errors
Common errors & fixes
KeyError: 'a.b'
Using dot notation on a NestedDict that doesn't have nested keys, or the key is ambiguous because a key literally contains a dot.
fix
Use tuple keys like ('a', 'b') or check the key exists with 'in'.
AttributeError: 'NestedDict' object has no attribute 'to_dict'
Calling to_dict() on older version before 0.3.0; method may be named differently or not exist.
fix
Upgrade to latest: pip install --upgrade ndicts. On older versions use dict(nd) or nd.flat().
Upgrade
Version history
0.3.0latest on PyPI · released Jan 4, 2023
Audit
Dependencies

No dependency data recorded yet.

Agent activity
6 hits · last 30 days
node
6
Resources
ndicts — pip install ndicts · libregistry