Skip to main content

Parallel HTTP request batcher with rate limiting, retries, connection pooling, and more.

Project description

abatcher

Simple parallel HTTP request batcher with rate limiting, retries, connection pooling, and more. The entire API is only 1 function.

🛠️ Usage

Using abatcher should be as simple as:

import abatcher

requests = [
    # Simple URL GET request
    "https://httpbin.org/anything",
    # Custom request
    {
        "url": "https://httpbin.org/post",
        "method": "POST",
        "params": {"name": "Test"},
        "headers": {"X-Custom": "value"},
    },
]

results = abatcher.run(requests)

print(f"Batch requests results: {results}")

If you need more control, you can also send a custom client.

import httpx
import abatcher

custom_client = httpx.AsyncClient(
    auth=("user", "pass"),
    timeout=httpx.Timeout(45.0),
    limits=httpx.Limits(max_connections=100, max_keepalive_connections=20),
)

results = abatcher.run(
    requests,
    client=custom_client,
    max_concurrent=20,
    max_per_second=10,
    cache=True,
    cache_dir="custom_cache",
    cache_ttl=3600,
)

print(f"Batch requests results: {results}")

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

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

abatcher-0.2.0-py3-none-any.whl (6.3 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: abatcher-0.2.0.tar.gz
  • Upload date:
  • Size: 5.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.7.2

File hashes

Hashes for abatcher-0.2.0.tar.gz
Algorithm Hash digest
SHA256 7f39c72d99cd8c028f0fc800b4c741e8be6ff7ea1cce0d95c2fb1a426b937280
MD5 9e9661ad1c99eace859a88b1a53166be
BLAKE2b-256 e8b403907ecb4e323f83aad93f0212e8a340ff4cc0f5ede94635807c5387a8d0

See more details on using hashes here.

File details

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

File metadata

  • Download URL: abatcher-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 6.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.7.2

File hashes

Hashes for abatcher-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 ac243c664afacc8e62c819fff7b8db702d18e45fa948945f3cb35ccf8a6a9d80
MD5 44e0d72557fb5da686b26802352b7920
BLAKE2b-256 bde19a458296de657fa8bbf9b0a4ed6cc7edf418d6f2661491a1a4c9bbec78fb

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