Json to pydantic
Skill ComeOnOliver/skillshub/skills/rominirani/antigravity-skills/json-to-pydantic
🧠The right skill, one API call. AI agent skills registry with token-efficient skill resolution. 5,000+ skills from 500+ top repos.From the repository description
npx -y skills add ComeOnOliver/skillshub --skill json-to-pydanticAssembled from the repository path, not quoted from the project. Check it against their README if it does not work.
SKILL.md
0.9 KB, 233 tokens by cl100k_base, as published. Nobody here has run it
JSON to Pydantic Skill
This skill helps convert raw JSON data or API responses into structured, strongly-typed Python classes using Pydantic.
Instructions
-
Analyze the Input: Look at the JSON object provided by the user.
-
Infer Types:
string->strnumber->intorfloatboolean->boolarray->List[Type]null->Optional[Type]- Nested Objects -> Create a separate sub-class.
-
Follow the Example: Review
examples/to see how to structure the output code. notice how nested dictionaries likepreferencesare extracted into their own class.- Input:
examples/input_data.json - Output:
examples/output_model.py
- Input:
Style Guidelines
- Use
PascalCasefor class names. - Use type hints (
List,Optional) fromtypingmodule. - If a field can be missing or null, default it to
None.
What ships with it
Read from the repository
Just SKILL.md. No reference files, no scripts.