Skip to main content

A streamlined Python library for crafting HTTP requests and testing API

Project description

ReqFlow

ReqFlow is a Python library designed for efficient and intuitive API testing. ReqFlow offers a fluent and flexible interface for crafting and validating HTTP requests, making API testing both straightforward and adaptable. While it make sense to use standard approaches for a Python API testing, ReqFlow reduces the entry barrier for beginners and allows for more advanced use cases with RestAssured-like approach.

Features

  • Fluent API for building and sending HTTP requests.
  • Supports response handling and validations.
  • Customizable response validation using PyDantic models.
  • Convenient utility methods for common assertions and response manipulations.

The tool is still in development, braking changes are possible. Any feedback and contributions are highly appreciated.

Installation

Install ReqFlow using pip:

pip install reqflow

Quick Start

from reqflow import given, Client
from pydantic import BaseModel


# Define a Pydantic model for response validation
class ExampleModel(BaseModel):
    name: str
    value: int


# Initialize the client
client = Client(base_url="https://api.example.com")

# Use ReqFlow's fluent API
response = (given(client)
            .header("Authorization", "Bearer your_token")
            .query_param("param", "value")
            .when("GET", "/your_endpoint")
            .then()
            .validate_data(ExampleModel)
            .status_code(200)
            .get_content())

print(response)

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

ReqFlow-1.0.1a0.tar.gz (9.0 kB view details)

Uploaded Source

Built Distribution

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

ReqFlow-1.0.1a0-py3-none-any.whl (16.6 kB view details)

Uploaded Python 3

File details

Details for the file ReqFlow-1.0.1a0.tar.gz.

File metadata

  • Download URL: ReqFlow-1.0.1a0.tar.gz
  • Upload date:
  • Size: 9.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.6

File hashes

Hashes for ReqFlow-1.0.1a0.tar.gz
Algorithm Hash digest
SHA256 bc2f63305104bce9edf5868a29f5ba271bd0ad6cb558e0bb31bfe718ca81dbb2
MD5 bafabb198ea98b3f8d2d6377284d8b61
BLAKE2b-256 4c3f993fe269b5a46c17716618c7d50daf50764eef48590230930053646be916

See more details on using hashes here.

File details

Details for the file ReqFlow-1.0.1a0-py3-none-any.whl.

File metadata

  • Download URL: ReqFlow-1.0.1a0-py3-none-any.whl
  • Upload date:
  • Size: 16.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.6

File hashes

Hashes for ReqFlow-1.0.1a0-py3-none-any.whl
Algorithm Hash digest
SHA256 57401e5875089486b652bea528f7f5601fc2a0f260d11518c841c467d124a10b
MD5 8d8f1fa15b426af4e8ab72262c9d550f
BLAKE2b-256 a3498235b72f72002e60c39ef3de29a8c4eec6e9a2a6ba4a499bfc4210f1b8c4

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