← ClaudeAtlas

jsonlisted

Use this skill any time a JSON (JavaScript Object Notation) file is the primary input or output. This includes tasks to: read, parse, validate, analyze, or modify JSON files; create new JSON files; merge or transform JSON structures; extract data from JSON; convert data to JSON format. If the user mentions a JSON file by name, extension, or path (.json), use this skill.
Everfern-AI/Everfern · ★ 15 · Data & Documents · score 80
Install: claude install-skill Everfern-AI/Everfern
# JSON File Handling in EverFern ## Overview Users may ask you to read, analyze, create, or modify JSON files. Use Python with built-in `json` module or `pandas` for structured data. Use absolute Windows paths (e.g., `C:\Users\Username\Downloads\data.json`). ## Reading JSON Files ### Read and Parse JSON ```python import json # Read JSON file with open(r'C:\path\to\file.json', 'r') as f: data = json.load(f) # Print formatted JSON print(json.dumps(data, indent=2)) # Get specific values value = data['key'] nested_value = data['parent']['child'] ``` ### Read with pandas (for tabular JSON) ```python import pandas as pd # Read JSON file as DataFrame df = pd.read_json(r'C:\path\to\file.json') # Preview data print(df.head()) print(df.info()) ``` ## Writing JSON Files ### Write Python Objects as JSON ```python import json data = { 'name': 'John', 'age': 30, 'email': 'john@example.com', 'hobbies': ['reading', 'coding', 'gaming'] } # Write to file (formatted) with open(r'C:\path\to\output.json', 'w') as f: json.dump(data, f, indent=2) # Write minified (compact) with open(r'C:\path\to\output_minified.json', 'w') as f: json.dump(data, f) ``` ## Parsing and Transforming JSON ### Parse JSON String ```python import json json_string = '{"name": "Alice", "age": 25}' data = json.loads(json_string) # Parse string print(data['name']) ``` ### Convert JSON to String ```python json_string = json.dumps(data, indent=2) print(json_string) ``` ### Va