Skip to content

gobind-singh/api-spec-toolkit

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 

Repository files navigation

API Spec Toolkit

A Python script to extract API endpoint details from Swagger/OpenAPI YAML files and convert them into a structured CSV format. This tool is perfect for API documentation, analysis, and review workflows.


Features

  • Supports Swagger/OpenAPI 3.0 specifications.
  • Extracts and organizes:
    • Tags: API categories for grouping endpoints.
    • Methods: HTTP methods (GET, POST, PUT, DELETE, etc.).
    • Paths: API endpoint paths.
    • Summary: Short API descriptions.
    • Description: Detailed API documentation.
  • Outputs a clean CSV file for further processing or review.

Table of Contents


Installation

Prerequisites

  • Python 3.x
  • PyYAML library (for reading YAML files)

Install the required dependency using pip:

pip3 install pyyaml

Clone the Repository

git clone https://github.com/gobind-singh/api-spec-toolkit.git
cd api-spec-toolkit

Usage

Run the script with the following command:

python3 extractor.py <input_swagger.yaml> <output_file.csv>

Parameters:

  • <input_swagger.yaml>: Path to your Swagger/OpenAPI YAML file.
  • <output_file.csv>: Path where the resulting CSV file will be saved.

Input Example

openapi: 3.0.0
info:
  title: Sample API
  version: "1.0"
paths:
  /users:
    get:
      tags:
        - Users
      summary: Get Users
      description: Fetch a list of users.
  /users/{id}:
    get:
      tags:
        - Users
      summary: Get User by ID
      description: Fetch a user by their ID.
  /orders:
    post:
      tags:
        - Orders
      summary: Create Order
      description: Create a new order.

Output Table

Tag Method Path Summary Description
Users GET /users Get Users Fetch a list of users.
Users GET /users/{id} Get User by ID Fetch a user by their ID.
Orders POST /orders Create Order Create a new order.

About

Parser for swagger files - Convert Swagger yaml to csv

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages