Skip to main content

Vedro + HTTPX

Project description

vedro-httpx

Codecov PyPI PyPI - Downloads Python Version

Vedro + HTTPX

Installation

Quick

For a quick installation, you can use a plugin manager as follows:

$ vedro plugin install vedro-httpx

Manual

To install manually, follow these steps:

  1. Install the package using pip:
$ pip3 install vedro-httpx
  1. Next, activate the plugin in your vedro.cfg.py configuration file:
# ./vedro.cfg.py
import vedro
import vedro_httpx


class Config(vedro.Config):
    class Plugins(vedro.Config.Plugins):
        class VedroHTTPX(vedro_httpx.VedroHTTPX):
            enabled = True

Usage

AsyncHTTPInterface

from vedro_httpx import Response, AsyncHTTPInterface

class AuthAPI(AsyncHTTPInterface):
    def __init__(self, base_url: str = "http://localhost:8080") -> None:
        super().__init__(base_url)

    async def register(self, creds: dict[str, str]) -> Response:
        return await self._request("POST", "/auth/register", json=creds)

SyncHTTPInterface

from vedro_httpx import Response, AsyncHTTPInterface

class AuthAPI(AsyncHTTPInterface):
    def __init__(self, base_url: str = "http://localhost:8080") -> None:
        super().__init__(base_url)

    async def register(self, creds: dict[str, str]) -> Response:
        return await self._request("POST", "/auth/register", json=creds)

Documentation

Check out the documentation for additional information about vedro-httpx.

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

vedro_httpx-0.5.0.tar.gz (29.1 kB view details)

Uploaded Source

Built Distribution

vedro_httpx-0.5.0-py3-none-any.whl (33.7 kB view details)

Uploaded Python 3

File details

Details for the file vedro_httpx-0.5.0.tar.gz.

File metadata

  • Download URL: vedro_httpx-0.5.0.tar.gz
  • Upload date:
  • Size: 29.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.7

File hashes

Hashes for vedro_httpx-0.5.0.tar.gz
Algorithm Hash digest
SHA256 017b18c195eb836bb6c0dce8ea281a7de1169a8d2346f8d1faa458d51a82a370
MD5 9cee236579888fc0c7f12af355454fc5
BLAKE2b-256 17de5ff35284768d09d56dcd8aa851b6ab1df321099798aeda343d67dad25fdc

See more details on using hashes here.

File details

Details for the file vedro_httpx-0.5.0-py3-none-any.whl.

File metadata

  • Download URL: vedro_httpx-0.5.0-py3-none-any.whl
  • Upload date:
  • Size: 33.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.7

File hashes

Hashes for vedro_httpx-0.5.0-py3-none-any.whl
Algorithm Hash digest
SHA256 01373edccb3c407e4e45a208a207cacc5fb1d4fb3b75f93d20709fb0b3e5255c
MD5 efa857e6bf77ab917a8727cc47798d83
BLAKE2b-256 daa4085511279a7729465ed5f47a4588a2b2b5ffa11e9cc9305ef7ad62997dc3

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