
Json Data Handling
This covers the JSON fundamentals you actually need: parsing, serialization, file I/O, and pretty printing in both Python and JavaScript. It goes beyond basics with custom encoders for datetime objects, circular reference handling, and streaming large files with ijson instead of loading everything into memory. The deep merge and safe nested access patterns are genuinely useful for real API work. What I appreciate is the direct comparison between Python's json module and JavaScript's JSON object, plus the jsonschema validation example that saves you from writing manual checks. The streaming section is brief but points you in the right direction when you hit that 500MB JSON file.
- skills.sh installs
- 394
- GitHub stars
- 79
- last updated
- Aug 21, 2026
Install
$ npx -y skills add bobmatnyc/claude-mpm-skills --skill json-data-handling --agent claude-codeInstalls into .claude/skills of the current project.
Files
JSON Data Handling
Working effectively with JSON data structures.
Python
Basic Operations
import json
# Parse JSON string
data = json.loads('{"name": "John", "age": 30}')
# Convert to JSON string
json_str = json.dumps(data)
# Pretty print
json_str = json.dumps(data, indent=2)
# Read from file
with open('data.json', 'r') as f:
data = json.load(f)
# Write to file
with open('output.json', 'w') as f:
json.dump(data, f, indent=2)
Advanced
# Custom encoder for datetime
from datetime import datetime
class DateTimeEncoder(json.JSONEncoder):
def default(self, obj):
if isinstance(obj, datetime):
return obj.isoformat()
return super().default(obj)
json_str = json.dumps({'date': datetime.now()}, cls=DateTimeEncoder)
# Handle None values
json.dumps(data, skipkeys=True)
# Sort keys
json.dumps(data, sort_keys=True)
JavaScript
Basic Operations
// Parse JSON string
const data = JSON.parse('{"name": "John", "age": 30}');
// Convert to JSON string
const jsonStr = JSON.stringify(data);
// Pretty print
const jsonStr = JSON.stringify(data, null, 2);
Sponsors
Details
- Repository
- github.com/bobmatnyc/claude-mpm-skills
- First seen
- Jun 3, 2026
More from bobmatnyc/claude-mpm-skills
All 158- Systematic Debugging391
- Vue390
- Api Documentation389
- Screenshot389
- Software Patterns382
- Nextjs V16380
- Vercel Deployments Builds378
- Security Scanning377
- Test Quality Inspector376
- Svelte5 Runes Static373
- Stacked Prs371
- Better Auth Core368
- Homebrew Formula Maintenance366
- Better Auth Integrations363
- Reporting Pipelines363
- Better Auth Plugins362
- Git Worktrees360
- Nextjs Core357
- Fastapi Local Dev356
- Vb Winforms356
- Headlessui355
- Jest Typescript354
- Vercel Networking Domains353
- Svelte352