Skip to main content

Convert Postman Collections to OpenAPI (Swagger) specification

Project description

Postman2OpenAPI

A Python module to convert Postman collections to OpenAPI (Swagger) format without any third-party dependencies.

Installation

pip install postman2openapi

Usage

from postman2openapi import PostmanToOpenAPIConverter, read_postman_collection, write_openapi_spec

# Read your Postman collection
collection_data = read_postman_collection("path/to/collection.json")

# Create converter instance
converter = PostmanToOpenAPIConverter()

# Convert to OpenAPI
openapi_spec = converter.parse_postman_collection(collection_data)

# Save as YAML (default) or JSON
write_openapi_spec(openapi_spec, "openapi_spec.yaml")  # For YAML
write_openapi_spec(openapi_spec, "openapi_spec.json", format="json")  # For JSON

Features

  • Converts Postman collections to OpenAPI 3.0.0 specification
  • Supports:
    • Basic request information (URL, method, description)
    • Query parameters
    • Request bodies (JSON and form-data)
    • Path parameters
    • Folder structure
  • No third-party dependencies except PyYAML
  • Outputs in both YAML and JSON formats

Development

To set up the development environment:

# Clone the repository
git clone https://github.com/Pulkit-Py/postman2openapi.git
cd postman2openapi

# Create a virtual environment
python -m venv venv
source venv/bin/activate  # On Windows: venv\Scripts\activate

# Install development dependencies
pip install -e ".[dev]"

# Run tests
pytest

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

License

This project is licensed under the MIT License - see the LICENSE file for details.

Author

Created by Pulkit-Py

Connect with Me

Package Information

  • Version: 1.0.0
  • Last Updated: 2025-05-04
  • Created: 2025-05-04
  • PyPI: postman2openapi

Support

If you found this project helpful, consider:

  • Giving it a ⭐ on GitHub
  • Following me on social media
  • Sharing it with others who might find it useful

Made with ❤️ by Pulkit-Py From 🇮🇳 India

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

postman2openapi-1.0.1.tar.gz (8.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

postman2openapi-1.0.1-py3-none-any.whl (7.8 kB view details)

Uploaded Python 3

File details

Details for the file postman2openapi-1.0.1.tar.gz.

File metadata

  • Download URL: postman2openapi-1.0.1.tar.gz
  • Upload date:
  • Size: 8.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.2

File hashes

Hashes for postman2openapi-1.0.1.tar.gz
Algorithm Hash digest
SHA256 8d6816aa88123c1fa7ca8c55853379e37edb3487e0c4a45f40a2ee8dbd115cc8
MD5 0b2f3c4579bd2c76006fef47f3403288
BLAKE2b-256 229445c9cd2f9c37631778c7ab2973025117e799dd2ddb88cf4e3809e6eba1cb

See more details on using hashes here.

File details

Details for the file postman2openapi-1.0.1-py3-none-any.whl.

File metadata

File hashes

Hashes for postman2openapi-1.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 a4f9817dd149d29c3f7a3b4d8d21005791333d08e8f3d1af3440962b83c55ac6
MD5 092d13fc42725e4c84ca21407c407243
BLAKE2b-256 eb35c70167d09e3cca68b63cfb299d09f160d7686530d4201361fdaa5c0b2a75

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page