{"id":6735,"library":"nested-lookup","title":"Nested Lookup","description":"Nested-lookup is a Python library providing functions for working with deeply nested documents, typically a mix of dictionaries and lists, often derived from JSON, YAML, or XML. It simplifies tasks like performing key lookups, updating values, deleting keys, and altering values within these complex structures. The library is currently at version 0.2.25, with its last release in July 2022, indicating a maintenance cadence rather than active rapid development.","status":"maintenance","version":"0.2.25","language":"en","source_language":"en","source_url":"https://git.unturf.com/python/nested-lookup/","tags":["nested","document","dictionary","dict","list","lookup","json","yaml"],"install":[{"cmd":"pip install nested-lookup","lang":"bash","label":"Install with pip"}],"dependencies":[],"imports":[{"symbol":"nested_lookup","correct":"from nested_lookup import nested_lookup"},{"symbol":"nested_update","correct":"from nested_lookup import nested_update"},{"symbol":"nested_delete","correct":"from nested_lookup import nested_delete"}],"quickstart":{"code":"from nested_lookup import nested_lookup, nested_update, nested_delete\n\ndocument = [\n    {'taco': 42},\n    {\n        'salsa': [\n            {'burrito': {'taco': 69}},\n            {'nachos': 100}\n        ]\n    },\n    {'drink': {'soda': 'coke'}}\n]\n\n# Lookup a key\ntacos = nested_lookup('taco', document)\nprint(f\"Found tacos: {tacos}\")\n# Expected: Found tacos: [42, 69]\n\n# Update a value (returns a copy by default)\nupdated_document = nested_update(document, key='burrito', value='test_burrito_update')\nprint(f\"Updated document (copy): {updated_document[1]['salsa'][0]}\")\n# Expected: Updated document (copy): {'burrito': 'test_burrito_update'}\n\n# Delete a key (returns a copy by default)\ndeleted_document = nested_delete(document, 'taco')\nprint(f\"Document after deleting 'taco' (copy): {deleted_document[0]}, {deleted_document[1]['salsa'][0]}\")\n# Expected: Document after deleting 'taco' (copy): {}, {'burrito': {'taco': 69}} (Note: original 'taco' in burrito is not deleted here as the key 'taco' at the top level of the inner dict is not directly deleted.)\n\n# Demonstrate in_place update\nprint(f\"Original document before in_place update: {document[0]}\")\nnested_update(document, key='taco', value='new_taco_val', in_place=True)\nprint(f\"Original document after in_place update: {document[0]}\")\n# Expected: Original document after in_place update: {'taco': 42}\\nOriginal document after in_place update: {'taco': 'new_taco_val'}\n","lang":"python","description":"This quickstart demonstrates how to use `nested_lookup` to find values, `nested_update` to change values, and `nested_delete` to remove keys from a deeply nested document. It also highlights the `in_place` argument for mutation."},"warnings":[{"fix":"For in-place modification, use `nested_function(document, ..., in_place=True)`. Otherwise, assign the returned value to a new variable: `new_document = nested_function(document, ...)`.","message":"Functions like `nested_update`, `nested_delete`, and `nested_alter` return a modified copy of the document by default. To mutate the original document in place, you must explicitly pass `in_place=True`. Failing to do so can lead to confusion if you expect the original object to change.","severity":"gotcha","affected_versions":"All versions"},{"fix":"Refer to the GitLab repository (`https://git.unturf.com/python/nested-lookup/`) for the most current source and project information.","message":"The official GitHub repository (`russellballestrini/nested-lookup`) has been archived and redirects to a GitLab instance (`https://git.unturf.com/python/nested-lookup/`). Users looking for the source code or contributing might initially go to the outdated GitHub link.","severity":"gotcha","affected_versions":"All versions since July 2022"},{"fix":"Only use `wild=True` when case-insensitive substring matching is explicitly required. For exact key matches, ensure `wild` is `False` (which is the default).","message":"The `wild` argument in `nested_lookup` treats the given key as a case-insensitive substring. This can lead to broader matches than intended if an exact, case-sensitive key lookup is desired.","severity":"gotcha","affected_versions":"All versions"},{"fix":"Review the GitLab repository's commit history for recent activity or consider contributing if specific enhancements are needed.","message":"The library's last release was in July 2022. While functional, this indicates a slower development pace, and new features or bug fixes might not be released frequently. Users should consider this for long-term project planning or if specific, unaddressed issues arise.","severity":"gotcha","affected_versions":"0.2.25 and older"}],"env_vars":null,"last_verified":"2026-04-15T00:00:00.000Z","next_check":"2026-07-14T00:00:00.000Z","problems":[]}