{"id":24244,"library":"plucky","title":"plucky","description":"Plucking (deep) keys/paths safely from python collections has never been easier. Version 0.4.3. Low activity, last release Jul 2021.","status":"maintenance","version":"0.4.3","language":"python","source_language":"en","source_url":"https://github.com/randomir/plucky","tags":["pluck","deep-get","nested-dict","data-access"],"install":[{"cmd":"pip install plucky","lang":"bash","label":"PyPI"}],"dependencies":[],"imports":[{"note":"","wrong":null,"symbol":"pluck","correct":"from plucky import pluck"},{"note":"","wrong":null,"symbol":"set_keys","correct":"from plucky import set_keys"}],"quickstart":{"code":"from plucky import pluck, set_keys\n\ndata = {'a': {'b': [{'c': 1}, {'c': 2}]}}\n# pluck deep key\nresult = pluck(data, 'a.b.0.c')\nprint(result)  # 1\n\n# set deep key\nset_keys(data, 'a.b.0.c', 42)\nprint(pluck(data, 'a.b.0.c'))  # 42","lang":"python","description":"Basic usage of pluck and set_keys"},"warnings":[{"fix":"Use pluck(data, 'missing.key', default=None) or pluck(data, 'missing.key', safe=True).","message":"pluck raises KeyError by default if path does not exist; use default= or safe=True to avoid exceptions.","severity":"gotcha","affected_versions":">=0.4.0"},{"fix":"Use 'items.0.name' instead of 'items[0].name'.","message":"Path syntax uses dot-separated keys and integer indices for lists (e.g., 'a.0.b'), not bracket notation.","severity":"gotcha","affected_versions":"all"},{"fix":"Replace plucks(data, path) with pluck(data, path, default=...).","message":"The function 'plucks' (plural) is deprecated in favor of 'pluck' with safe=True or default.","severity":"deprecated","affected_versions":">=0.3.0"}],"env_vars":null,"last_verified":"2026-05-01T00:00:00.000Z","next_check":"2026-07-30T00:00:00.000Z","problems":[{"fix":"Use 'from plucky import pluck' instead of 'import plucky' and plucky.pluck.","cause":"Importing incorrectly (e.g., import plucky then plucky.pluck) but module exposes functions only via direct import.","error":"AttributeError: module 'plucky' has no attribute 'pluck'"},{"fix":"Add default parameter: pluck(data, 'missing.key', default=None).","cause":"Using pluck without a default or safe mode when path doesn't exist.","error":"KeyError: 'missing'"},{"fix":"Ensure path segments for list indices are integers, e.g., 'items.0.name'.","cause":"Path segment is not a valid integer index when accessing a list element.","error":"ValueError: invalid literal for int() with base 10: 'key'"}],"ecosystem":"pypi","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}