Nested Utils

Dot-path access made easy for Python's JSON, dict, and list structures.

Gallery image 1

Nested Utils

Dot-path get / set / delete for nested Python dicts and lists, without hand-written guards

nestedutils is a small, dependency-free Python library for navigating nested dicts, lists, and tuples (read-only for tuples) using string paths like users.0.profile.name or list paths when keys contain dots. It exposes get_at, set_at, delete_at, exists_at, plus helpers such as depth, leaf counts, and all paths, with PathError codes documented in the README.

When it is useful

You are parsing JSON APIs, editing config trees, or remapping nested payloads and want less boilerplate than chained try / .get patterns. Install from PyPI; docs and a browser playground are linked from the repository.

What you can do

  • Read deep values with optional defaults, or write with create=True to add missing intermediate containers where the API allows.
  • Use negative list indices for existing elements, introspection helpers for debugging shape, and safety limits (documented max depth and index bounds) to catch runaway paths.
  • Follow the v2 migration notes if you upgrade from older major versions.

Limits

  • It is a data-navigation helper, not a schema validator; pair with real validation for untrusted input.
  • List deletion is deliberately guarded; understand allow_list_mutation before mutating lists in place.
  • Behavior and edge cases are defined by the published API; always check the version you pinned in production.

You might also like

Explore All Blogs