Skip to content
Back to skills

Json To Pydantic

ASecurity

Converts JSON data snippets into Python Pydantic data models.

  • 33 stars
  • 0 votes
  • 0 copies
  • 2 views
  • Added September 1, 2026
ai-agentspythonapi

Works with

  • api

Security analysis

A100/100

Pro scans all 3 files and shows the line behind each finding

Scanned September 1, 2026

npx -y skills add phenobarbital/ai-parrot --skill json-to-pydantic --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Json To Pydantic?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Json To Pydantic
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/phenobarbital-json-to-pydantic/badge)](https://www.skillsdirectory.com/skills/phenobarbital-json-to-pydantic)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: json-to-pydantic
description: Converts JSON data snippets into Python Pydantic data models.
---

# JSON to Pydantic Skill

This skill helps convert raw JSON data or API responses into structured, strongly-typed Python classes using Pydantic.

## Instructions

1. **Analyze the Input**: Look at the JSON object provided by the user.
2. **Infer Types**:
   - `string` -> `str`
   - `number` -> `int` or `float`
   - `boolean` -> `bool`
   - `array` -> `List[Type]`
   - `null` -> `Optional[Type]`
   - Nested Objects -> Create a separate sub-class.
   
3. **Follow the Example**:
   Review `examples/` to see how to structure the output code. notice how nested dictionaries like `preferences` are extracted into their own class.
   
   - Input: `examples/input_data.json`
   - Output: `examples/output_model.py`

## Style Guidelines
- Use `PascalCase` for class names.
- Use type hints (`List`, `Optional`) from `typing` module.
- If a field can be missing or null, default it to `None`.

Files in this skill

  • SKILL.md996 B
  • examples/input_data.json269 B
  • examples/output_model.py334 B

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.