Skip to main content

risureq — Python HTTP Client

Reliable requests. Thoughtful engineering.
A Python HTTP client for connection pooling, cookies, proxies, retries, and safer request handling.

PyPI version PyPI downloads Python versions MIT License

risureq is the Python distribution for the RisuReq HTTP client. It provides a straightforward API for making HTTP requests, with a reusable client for connection pooling and cookie persistence.

Package name: risureq
Python import name: risu_req
Python requirement: 3.10 or newer

Contents

Installation

Install from PyPI:

python -m pip install risureq

For optional Brotli support, if the package's optional extra is available in the published release:

python -m pip install "risureq[brotli]"

Quick start

import risu_req

response = risu_req.get("https://httpbin.org/get")

print(response.status_code)
print(response.json())

Pass query parameters and headers as needed:

import risu_req

response = risu_req.get(
    "https://httpbin.org/get",
    params={"client": "risureq"},
    headers={"User-Agent": "risureq-example/1.0"},
    timeout=10.0,
)

print(response.status_code)
print(response.json())

Reusable client

Use RisuClient when you want to reuse client configuration and connections across requests.

import risu_req

with risu_req.RisuClient(
    base_url="https://httpbin.org",
    cookies=True,
    timeout=10.0,
) as client:
    first = client.get("/get", params={"request": "first"})
    second = client.get("/get", params={"request": "second"})

    print(first.status_code, first.json())
    print(second.status_code, second.json())

Using a context manager closes the client when the block ends.

Request methods

The package exposes convenience functions for common HTTP methods:

import risu_req

response = risu_req.post(
    "https://httpbin.org/post",
    json={"message": "Hello, risureq!"},
    headers={"User-Agent": "risureq-example/1.0"},
)

print(response.status_code)
print(response.json())

Available convenience methods include get, post, put, patch, delete, head, and options, alongside the general request function. Check the installed package's API for supported arguments and return types.

Configuration

Depending on the API and options supported by the installed version, configuration can include:

  • Timeouts for connection and response waiting.
  • Cookies for maintaining state between requests.
  • Proxies for routing requests through configured proxy servers.
  • Retries for eligible transient failures.
  • Connection pooling for reusing connections.
  • Response limits to bound response-body consumption.
  • Redirect handling to control redirect behavior.

Consult the source and API documentation for exact option names, defaults, and security behavior. Do not assume a security control is enabled unless the installed version's configuration and documentation confirm it.

Features

  • Simple convenience functions and a reusable RisuClient.
  • Connection pooling and cookie-jar support.
  • Proxy configuration.
  • Configurable retry behavior.
  • Request timeout and response-size controls.
  • Structured response objects and library-specific exceptions.
  • Response decompression support, depending on installed optional dependencies and server encoding.

Feature availability may vary by release and configuration.

Errors and retries

Requests can fail because of connection problems, timeouts, proxy errors, TLS issues, invalid URLs, or HTTP responses. Handle exceptions appropriate to the operation and your installed version. Retry only operations that are safe to repeat; retrying a request with side effects can cause duplicate actions.

Development

From the repository root, enter the Python package directory:

cd packages/python

Install the package and test dependencies:

python -m pip install -e ".[test]"

Run the tests:

python -m pytest

Build the distribution:

python -m pip install build
python -m build

If a command differs from the project's current development setup, follow the repository's pyproject.toml and contribution instructions.

License

MIT. See the repository's LICENSE.

Metadata

Release files for risureq 1.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 risureq 1.0.1
File Size Uploaded Provenance
risureq-1.0.1.tar.gz 22.7 kB Without provenance Details

Built distribution (wheel)

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

Total release size: 45.7 kB

Release files / risureq-1.0.1.tar.gz

Download URL risureq-1.0.1.tar.gz
Size 22.7 kB
Tags Source
SHA-256 checksum
How to use checksums
fdbbef207214f0469187a2de96afbfef9772ec50d5ab98716d864543ed2c18c7
BLAKE2b-256 checksum
How to use checksums
5d8db45133c58b6b929f851deeb91020e2f28ca9afc88b561f847497e982fef9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.6

Release files / risureq-1.0.1-py3-none-any.whl

Download URL risureq-1.0.1-py3-none-any.whl
Size 23.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
0d894338504e4f258e5774f69dc470bd45a7a0d8759ff18920dec2ffcf78c525
BLAKE2b-256 checksum
How to use checksums
d4d8f8f5253455e7bffa9a29c98afaac0d88f14f89fe652ec795b1316d9ba33a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.6

Security for risureq 1.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

1.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