Skip to main content

Zapy SDK for Zapy REST client

Project description

The pythonic REST client and testing tool.

Test Coverage Version Package version Supported Python versions

Zapy REST Client - SDK

Zapy REST Client is an extension for VSCode that serves as a tool for testing APIs. The accompanying Zapy SDK, a Python library, is an integral component that enables the utilization of Zapy request files, empowering the client and Python scripts to perform API operations. The primary goal is to streamline the process of API testing.


Documentation: https://docs.zapy.dev

Github repo: https://github.com/ZapyLabs/zapy-sdk

FAQ: https://zapy.dev/faq


Key features

❤️ Python/Jinja2 expressions: Utilize 🐍 Python and Jinja2 expressions for variable declaration and string templating.

🗔 Visual interface: Enjoy the VSCode extension for rapid development, enhancing productivity and ease of use.

⚡️ Async operations: Support async functions, hooks and stores for handling requests and responses.

📝 File based and git sync: Manage your requests with file-based local storage and optional Git for collaboration 👨‍👩‍👧‍👦.

🐍 Python scripting and tests. Leverage Python scripting capabilities and conduct tests within the client. Import packages and use snippets for enhanced functionality and customization.

🚀 CI/CD Ready: Import and execute request files directly within your integration tests.

♻️ Request reusability and invocation: Reuse requests and integrate seamlessly with your favorite tools such as pytest, Playwright, or Robot Framework, enhancing interoperability and extensibility.

🔗 Chaining: Chain requests using Jupyter notebooks and/or stores, facilitating interactive exploration and collaboration.

Requirements

Python 3.11+

For using the VSCode extension:

  • Python virtual environment
  • Zapy SDK
  • VSCode

Usage

  1. Install Zapy VSCode Extension.

  2. Install the python library under a virtual environment.

    pip install zapy-sdk
    
  3. Create a .zapy file, for example my_first_request.zapy.

  4. Start the Zapy server.

  5. Send your request 🚀.

installation

Requests

Create requests visually using the Zapy VSCode Extension.

first look

Stores

Stores enable the persistence and inspection of Python data for use in multiple requests, including the creation and management of environment variables.

stores

Hooks

Hooks can be global or request-specific, allowing interception and modification of requests, such as for authentication.

from zapy.requests import hooks, HttpxArguments

@hooks.pre_request
async def on_each_request(httpx_args: HttpxArguments):
    httpx_args['auth'] = ('alice', 'ecila123')
    print(httpx_args)

Chaining

Chaining runs a sequence of requests with one click, using responses from one request in the next. It also offers the ability to use conditionals or to resume from a failed step.

chaining

Integration test

Requests and their tests can be invoked directly on your integration tests.

import pytest
from zapy import requests

@pytest.mark.asyncio
async def test_single():
    request = requests.from_path("request1.zapy")
    # if raise_assert is enabled, it will perform all assertions defined in the request file
    _ = await request.send(raise_assert=True)

Privacy

Data for authentication is collected when using Zapy VSCode Extension. No personal or request data is collected.

License

Zapy REST Client - SDK (a.k.a. Zapy SDK) is licensed under the terms of the Business Source License 1.1 (BSL). Zapy REST Client (a.k.a. Zapy VSCode Extension) is under End User Service Agreement.

By installing or running this software you expressly agree with the terms of use.

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

zapy_sdk-0.0.1a2.tar.gz (30.1 kB view details)

Uploaded Source

Built Distribution

zapy_sdk-0.0.1a2-py3-none-any.whl (32.4 kB view details)

Uploaded Python 3

File details

Details for the file zapy_sdk-0.0.1a2.tar.gz.

File metadata

  • Download URL: zapy_sdk-0.0.1a2.tar.gz
  • Upload date:
  • Size: 30.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.18

File hashes

Hashes for zapy_sdk-0.0.1a2.tar.gz
Algorithm Hash digest
SHA256 0e2170a9ca16726b300708b0a3df9fd09c347636df3777ba1eaf2f0c4b0bea7d
MD5 e8af9c4baaa94925cffce3558c24e0cb
BLAKE2b-256 9c1100b13b69b6f0429d6a7f34801bf3693557799c32b55ca2e586c7e6c88abf

See more details on using hashes here.

File details

Details for the file zapy_sdk-0.0.1a2-py3-none-any.whl.

File metadata

  • Download URL: zapy_sdk-0.0.1a2-py3-none-any.whl
  • Upload date:
  • Size: 32.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.18

File hashes

Hashes for zapy_sdk-0.0.1a2-py3-none-any.whl
Algorithm Hash digest
SHA256 afc108df083ee33d0d9bb50e3a037235343eca99698c62d9c9d90d57eb6f5b2b
MD5 19bee868417e7beabebbb439d7b7762e
BLAKE2b-256 66180b662368f79a77dbf3df66f2a34a0c8a545bc523d987a32d5d3b3c6d29cc

See more details on using hashes here.

Supported by

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