dto-factory-method

Community

Convert API responses into robust domain models.

Authordragonkid
Version1.0.0
Installs0

System Documentation

What problem does it solve?

This Skill translates messy external API responses into clean, typed domain models using Pydantic, applying a factory method to centralize conversion and provide consistent defaults.

Core Features & Use Cases

  • From API to domain: Convert varied API payloads to a unified domain model with a single factory method.
  • Default handling: Provide safe defaults for missing or optional fields to prevent runtime errors.
  • Output versatility: Support multiple outputs (e.g., structured prompts, JSON, and display-friendly strings) from a single model.
  • Decoupling: Keep API structure separate from domain logic to simplify maintenance and testing.

Quick Start

Define a Pydantic model and implement a from_api_response class method, then call it with your API payload to obtain a ready-to-use domain object.

Dependency Matrix

Required Modules

None required

Components

Standard package

💻 Claude Code Installation

Recommended: Let Claude install automatically. Simply copy and paste the text below to Claude Code.

Please help me install this Skill:
Name: dto-factory-method
Download link: https://github.com/dragonkid/dotfiles/archive/main.zip#dto-factory-method

Please download this .zip file, extract it, and install it in the .claude/skills/ directory.
View Source Repository

Agent Skills Search Helper

Install a tiny helper to your Agent, search and equip skill from 223,000+ vetted skills library on demand.