Skip to main content

# Swagern

Swagern is a command-line tool that automates the process of generating API test cases from a given Swagger or other API specification files. It leverages the power of fuzzy logic to match user-defined test case descriptions with the corresponding API endpoints defined in the specification file. The output is a set of Tavern YAML files that can be directly used to run API tests.

## Features

  • Fuzzy Matching: Swagern automatically maps user-defined test cases to API endpoints using fuzzy logic, allowing for more flexible test case definitions.

  • Customizable Output: Specify output directories or use the default location.

  • Integration with Various API Specifications: While initially built for Swagger files, Swagern aims to support various API specifications.

  • Environment Variable Mapping: Use a mapper file to define and load environment variables into your tests.

## Installation

Install Swagern using pip:

`bash pip install swagern ` ## Options

### –input Path to input test cases in YAML format. This is a required parameter.

### –output Path to the output directory where the Tavern test files will be generated. This is an optional parameter, and the default location is the tests directory in the current working directory.

### –mapper Path to the mapper YAML file, used for defining and loading environment variables into your tests.

### –api-spec Path to the Swagger or other API specifications file. This is an optional parameter. If not provided, Swagern will look for a default file path.

## Usage

Use the generate command to create Tavern YAML files based on your input file and specifications:

`bash swagern generate --input path/to/test_cases.yaml --output path/to/output-dir --mapper path/to/mapper-file --api-spec path/to/swagger.json `

Metadata

Release files for swagern 0.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for swagern 0.1
File Size Uploaded Provenance Actions
swagern-0.1.tar.gz 6.4 kB Without provenance Details for swagern-0.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for swagern 0.1
File Interpreter ABI Platform Actions
swagern-0.1-py3-none-any.whl Python 3 none any Details for swagern-0.1-py3-none-any.whl

Total release size: 13.6 kB

Release files / swagern-0.1.tar.gz

Download URL swagern-0.1.tar.gz
Size 6.4 kB
Tags Source
SHA-256 checksum
How to use checksums
ebc9b5fcc2436846c8969d56efe2df3f47b8b92f8c8b2476e1474e27d4a2f6b1
BLAKE2b-256 checksum
How to use checksums
060d21cea3e83bf8151d87ab66b1f364cb765f6b3a28d62556e70b9915109a5b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.11.0

Release files / swagern-0.1-py3-none-any.whl

Download URL swagern-0.1-py3-none-any.whl
Size 7.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
c480ddbcc9adcaca9345740df7403013c4b64961a35b9cc3e2c3afe60d53c864
BLAKE2b-256 checksum
How to use checksums
575696402d5ce8f3e5136d745aea994eb5574c0e4e0d74ad178a77afd197e4a9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.11.0

Security for swagern 0.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.1 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page