Skip to main content

Postman to k6 converter

Project description

⚡ gk6 – Generate k6 Load Tests from Postman Collections

License: MIT Python Docs

gk6 is a Python CLI tool that converts Postman collections into dynamic k6 performance testing scripts — with support for chaining variables, environment parsing, automated metrics, and HTML reporting. Built to automate what you shouldn’t have to hand-code.


🎯 Why gk6?

If you use Postman for API testing and k6 for performance testing, this tool connects the dots:

  • ✅ No need to rewrite each request manually
  • 🔁 It respects your chaining logic (pm.environment.set)
  • 🌐 Supports environments and headers out of the box
  • 📊 Visibility with built-in checks and trend metrics

✅ Features

  • ✅ Converts any Postman Collection to a runnable k6 script
  • ✅ Supports GET, POST, PUT, DELETE methods
  • 🔄 Recognizes and converts environment variables ({{var}})
  • 🔁 Detects request chaining via pm.environment.set()
  • 📊 Auto-generates Trend metrics and check() assertions
  • 🖥 CLI-friendly with argparse
  • 📄 Optional .env and HTML summary output with k6-reporter

🧱 Limitations

  • ❗ Currently supports only pm.environment.set() for chaining — pm.variables.set() is not yet handled.
  • ⚠️ Does not parse pre-request scripts or tests written in advanced Postman JavaScript.
  • 🔒 Sensitive auth flows (e.g., OAuth2 with token rotation) require manual setup.
  • 📄 HTML reporting requires k6-reporter installed and configured separately.
  • 📦 Limited to JSON-based Postman collections (v2.1+).

🚀 Quick Start

1. Install

No extra packages needed — just Python 3.8+ and k6

pip install poetry
poetry install

2. Run the CLI

poetry run gk6 --help

Convert a Postman collection and environment:

poetry run gk6 convert --collection postman.json --env environment.json

🛠 Development

Local Dev Commands

make test          # Run unit tests
make lint          # Run all linters
make format        # Apply black, isort formatting
make release       # Bump version and tag release

GitHub Actions

Includes CI for:

  • ✅ Linting (black, ruff)
  • ✅ Type checking (mypy)
  • ✅ Security scan (bandit, detect-secrets)
  • ✅ Version bump & release tagging

🔗 Links


📄 License

MIT License — see the LICENSE file for full text.

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

gk6-2.0.12.tar.gz (7.2 kB view details)

Uploaded Source

Built Distribution

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

gk6-2.0.12-py3-none-any.whl (8.2 kB view details)

Uploaded Python 3

File details

Details for the file gk6-2.0.12.tar.gz.

File metadata

  • Download URL: gk6-2.0.12.tar.gz
  • Upload date:
  • Size: 7.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for gk6-2.0.12.tar.gz
Algorithm Hash digest
SHA256 55a54abbfff437ec8d0d2ad0a212c1b9a99ed17956647ec91d06bc12ef32f5e2
MD5 c8a74492fdf8d00a1cccfebbff3e34c9
BLAKE2b-256 9abab6e576142b17c29f14397443be50a33974b93bc99d80dbdb4b880a94cace

See more details on using hashes here.

File details

Details for the file gk6-2.0.12-py3-none-any.whl.

File metadata

  • Download URL: gk6-2.0.12-py3-none-any.whl
  • Upload date:
  • Size: 8.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for gk6-2.0.12-py3-none-any.whl
Algorithm Hash digest
SHA256 a41db0ee67df261de526f639615f464b9f5a9029b1d10d0f0ac1010a9a483cdf
MD5 3a4e59610d8440bef43c5ca93e2afd61
BLAKE2b-256 b53f1c9ebc01dd9bb84e68348bf132af9758c2a4e7d9c420ab6381996e6c8e06

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