spec2mod

Generate a Python client package from OpenAPI, Swagger, Postman, or Insomnia specs.

Updated Mar 26, 2026
One-click install
npx skills add https://github.com/christophevg/c3 --skill spec2mod
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: spec2mod
Source: https://github.com/christophevg/c3/tree/main/skills/spec2mod
Command: npx skills add https://github.com/christophevg/c3 --skill spec2mod

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

spec2mod removes the repetitive work of manually translating an OpenAPI/Swagger/Postman spec into a usable Python client by generating a complete package for you.

Core Features & Use Cases

  • Python package generation from specs: Converts OpenAPI 3.x, Swagger 2.0, and Postman/Insomnia exports into a structured Python module.
  • Typed client, models, CLI, and REPL: Produces sync and async clients, dataclass-based models, an importable Python API, plus command-line and interactive REPL tooling.
  • Safe, spec-faithful outputs: Enforces required fields, preserves base URLs, and generates comprehensive endpoint documentation for verification.

Quick Start

Use the spec2mod skill to generate a Python package from your OpenAPI file located at /path/to/openapi.yaml.

Frequently Asked Questions about spec2mod

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I generate a Python client from an OpenAPI spec?

To generate a Python client from an OpenAPI spec, parse the specification file to extract endpoints, schemas, and security definitions. This process produces a complete Python package containing typed sync and async clients, dataclass models, and serialization helpers.

Can I create a typed Python API client from a Postman or Insomnia export?

Yes, you can create a typed Python API client from Postman or Insomnia exports. The specification is parsed into structured modules, generating dataclass-based models and comprehensive endpoint documentation to ensure the output client remains faithful to the original API definition.

Does generated Python client tooling include an interactive REPL for API testing?

Generated Python client tooling includes an interactive REPL for API testing. It produces an importable Python API alongside command-line tooling and interactive REPL commands directly derived from the input specification, enabling immediate integration and testing workflows.

What is the best way to enforce required fields and preserve base URLs when generating API clients?

The best way to enforce required fields and preserve base URLs when generating API clients is through spec-faithful package generation. This approach parses server definitions to preserve base URLs and enforces required fields within dataclass models to ensure safe, validated outputs.

Are async and sync clients both supported when converting Swagger 2.0 to Python?

Both async and sync clients are supported when converting Swagger 2.0 to Python. The conversion process parses the Swagger 2.0 specification into schemas and endpoints, producing a structured Python module that includes both synchronous and asynchronous client implementations.