
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
- 399
- GitHub stars
- 80
- 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 Debugging397
- Vue395
- Api Documentation394
- Screenshot393
- Software Patterns387
- Nextjs V16386
- Vercel Deployments Builds383
- Security Scanning382
- Test Quality Inspector381
- Svelte5 Runes Static377
- Stacked Prs376
- Better Auth Core373
- Homebrew Formula Maintenance370
- Better Auth Integrations368
- Reporting Pipelines368
- Better Auth Plugins367
- Git Worktrees365
- Vb Winforms363
- Nextjs Core362
- Fastapi Local Dev360
- Headlessui360
- Sec Edgar Pipeline358
- Vercel Networking Domains358
- Svelte357