Skip to main content

Lightweight, hackable HTTP client with adapter switching and middleware

Project description

lightreq

pipeline coverage

A lightweight, composable HTTP client for Python built around the chain-of-responsibility pattern

Installation

pip install lightreq

Usage

from src.client import HttpClient
from src.middleware import logging, retry

client = HttpClient(
    adapter="requests",
    middleware=[logging(), retry(retries=3)]
)

response = client.get(url="https://jsonplaceholder.typicode.com/todos/1")
print(response.is_ok())     # True
print(response.json())      # {'userId': 1, 'id': 1, ...}

client.close()

Documentation

Full documentation is available at lightreq.readthedocs.io

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

lightreq-0.2.0.tar.gz (5.4 kB view details)

Uploaded Source

Built Distribution

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

lightreq-0.2.0-py3-none-any.whl (2.8 kB view details)

Uploaded Python 3

File details

Details for the file lightreq-0.2.0.tar.gz.

File metadata

  • Download URL: lightreq-0.2.0.tar.gz
  • Upload date:
  • Size: 5.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.3

File hashes

Hashes for lightreq-0.2.0.tar.gz
Algorithm Hash digest
SHA256 f8ffa29f236bf66995b34ddb760f64742782b856ce03c52be31fac8a2f1556a5
MD5 e46db2b873773a438d8300294c931a29
BLAKE2b-256 5a51008748e8678c59a596c0bda1492ed820e182f30e8cc539350cf22b10464e

See more details on using hashes here.

File details

Details for the file lightreq-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: lightreq-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 2.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.3

File hashes

Hashes for lightreq-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 651fc4aadfb80bc60ee37cc3c641e2c783603a78147b9b9e991894d8b331a1c4
MD5 dd03e2ffec1973f3cecdf389d2a981d2
BLAKE2b-256 8943e4b3463d623de72a8d8e1b6d73f582dc21fc5c316148c8aad82b4b03507d

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