Python text search
Techniques to find specific data points in nested Python dictionaries using recursion.From its SKILL.md
npx -y skills add cxcscmu/SkillLearnBench --skill python-text-searchAssembled from the repository path, not quoted from the project. Check it against their README if it does not work.
SKILL.md
0.7 KB, 122 tokens by cl100k_base, as published. Nobody here has run it
Python Dictionary Search
Introduction
When dealing with enterprise JSON, you often have deeply nested dictionaries. Finding specific keys or values requires recursion.
Finding by Key
def find_key(obj, key):
results = []
if isinstance(obj, dict):
for k, v in obj.items():
if k == key:
results.append(v)
if isinstance(v, (dict, list)):
results.extend(find_key(v, key))
elif isinstance(obj, list):
for item in obj:
results.extend(find_key(item, key))
return results
What ships with it
Read from the repository
Just SKILL.md. No reference files, no scripts.