Skip to main content

eggfetch

eggfetch is a Rust-native HTTP client engine with Python bindings and a CLI tool. The core is async-first: a Rust engine built on tokio and hyper provides connection pooling, phase-aware timeouts, TLS configuration, streaming, and response decompression. The Python bindings expose both sync and async APIs; the sync API blocks on the async engine while releasing the GIL, and the async API integrates with asyncio. There is exactly one networking implementation, living entirely in Rust.

CI Crates.io PyPI version License

Features

  • HTTP/1.1, HTTP/2, HTTP/3 -- ALPN negotiation, multiplexed connections, experimental QUIC transport
  • Streaming -- request and response bodies stream without eager buffering; bytes_stream() and text_lines() for incremental reads
  • Response decompression -- gzip, brotli, zstd, deflate via feature-gated streaming decoders
  • Connection pooling -- semaphore-based concurrency with per-origin limits and pool metrics
  • Phase-aware timeouts -- pool, connect, write, read, and total timeout phases with cancellation safety
  • TLS -- rustls with custom CA bundles, client certificates (mTLS), version policy, and verification toggle
  • Proxy -- HTTP forwarding, HTTPS CONNECT tunneling, proxy auth, per-request override, NO_PROXY bypass
  • Cookies -- RFC 6265 cookie jar with domain/path matching, cross-origin stripping
  • Authentication -- Basic and Bearer auth with credential redaction in all output paths
  • Multipart -- streaming multipart/form-data with known-length optimization
  • Retries -- policy-driven retries with exponential backoff and Retry-After support
  • Python API -- requests/HTTPX-compatible sync and async interfaces, GIL-releasing blocking I/O
  • HTTPX drop-in -- compatible asyncio facade for HTTPX 0.28.1 (eggfetch.compat.httpx)
  • CLI -- full-featured HTTP client with streaming output, machine-readable formats, and shell completions

Installation

Python:

pip install eggfetch

Rust:

[dependencies]
eggfetch-core = { version = "0.1", features = ["http1", "tls-rustls"] }

CLI:

cargo install eggfetch-cli

Pre-built binaries for Linux, macOS, and Windows are available on the GitHub Releases page.

Usage -- Python

Quick requests

import eggfetch

r = eggfetch.get("https://httpbin.org/get")
print(r.status_code)
print(r.text)

Using a client

import eggfetch

with eggfetch.Client(headers={"User-Agent": "my-app/1.0"}) as client:
    # Buffered response
    r = client.get("https://httpbin.org/get")
    print(r.json())

    # POST with JSON body
    r = client.post("https://httpbin.org/post", json={"key": "value"})
    print(r.status_code)

    # Streaming response
    with client.stream("GET", "https://httpbin.org/stream-bytes/10000") as r:
        for chunk in r.iter_bytes():
            print(f"chunk: {len(chunk)} bytes")

Async client

import asyncio
import eggfetch

async def main():
    async with eggfetch.AsyncClient() as client:
        r = await client.get("https://httpbin.org/get")
        print(r.status_code)

        # Concurrent requests
        responses = await asyncio.gather(
            client.get("https://httpbin.org/get"),
            client.get("https://httpbin.org/ip"),
        )
        for resp in responses:
            print(resp.json())

asyncio.run(main())

Configuration

import eggfetch

client = eggfetch.Client(
    timeout=10.0,
    headers={"User-Agent": "my-app/1.0"},
    limits=eggfetch.Limits(max_connections=100),
    verify="/path/to/ca-bundle.pem",        # custom CA bundle
    cert=("/path/to/cert.pem", "/path/to/key.pem"),  # mTLS
    proxy="http://proxy:8080",
    http2=True,
)

HTTPX drop-in

from eggfetch.compat.httpx import Client, AsyncClient

# Drop-in replacement for httpx
client = Client()
response = client.get("https://example.com")

See docs/python/guide.md for the full Python API reference.

Usage -- Rust

Basic requests

use eggfetch_core::Client;

#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
    let client = Client::new();

    // GET request
    let resp = client.get("https://httpbin.org/get").send().await?;
    println!("Status: {}", resp.status());
    println!("Body: {}", resp.text().await?);

    // POST with JSON
    let resp = client
        .post("https://httpbin.org/post")
        .header("Content-Type", "application/json")
        .body(r#"{"key": "value"}"#)
        .send()
        .await?;
    println!("Status: {}", resp.status());

    Ok(())
}

Builder pattern

use eggfetch_core::{Client, Timeout};

let client = Client::builder()
    .timeout(Timeout::from_secs(30))
    .follow_redirects(true)
    .max_redirects(5)
    .user_agent("my-app/1.0")
    .automatic_decompression(true)
    .build();

let resp = client
    .get("https://httpbin.org/get")?
    .header("accept", "application/json")
    .query("page", "1")
    .send()
    .await?;

Streaming

use eggfetch_core::Client;
use futures_util::StreamExt;

let mut resp = client.get("https://httpbin.org/stream/3").send().await?;
let mut stream = resp.bytes_stream()?;

while let Some(chunk) = stream.next().await {
    let chunk = chunk?;
    println!("chunk: {} bytes", chunk.len());
}

Feature flags

[dependencies]
eggfetch-core = { version = "0.1", features = [
    "http1",          # HTTP/1.1 (default)
    "http2",          # HTTP/2 via ALPN
    "tls-rustls",     # TLS via rustls (default)
    "cookies",        # RFC 6265 cookie jar
    "proxy",          # HTTP proxy and CONNECT tunneling
    "compression-gzip",
    "compression-brotli",
    "compression-zstd",
    "compression-deflate",
    "multipart",      # streaming multipart/form-data
] }

See docs/rust/guide.md for the full Rust API reference.

Usage -- CLI

# GET request
eggfetch https://httpbin.org/get

# POST JSON
eggfetch -X POST https://httpbin.org/post --json '{"key": "value"}'

# With authentication
eggfetch --auth user:pass https://httpbin.org/basic-auth/user/pass

# Streaming download
eggfetch --output file.bin https://httpbin.org/stream-bytes/10000

# Machine-readable output
eggfetch --json-output https://httpbin.org/get

See docs/cli/guide.md for the full CLI reference.

HTTPX Compatibility

eggfetch provides an HTTPX 0.28.1-compatible asyncio facade via eggfetch.compat.httpx. The compatibility profile is pinned in compat/httpx/0.28.1/ with machine-readable API manifests and allowed-difference tracking.

Key differences from HTTPX:

  • Redirects are not followed by default (security-first; HTTPX 0.28.1 also defaults to follow_redirects=False)
  • Trio/AnyIO not supported (asyncio only, tokio-based)
  • SOCKS proxy not supported

See docs/reference/compatibility.md for the full feature matrix.

Documentation

Section Description
getting-started/ Installation and quickstart guide
concepts/ Architecture, lifecycle, timeouts, streaming, cookies, auth, proxy, TLS
rust/guide.md Rust API guide with examples
python/guide.md Python sync/async API guide
cli/guide.md CLI reference and usage guide
migration/ Migration guides from requests and HTTPX
cookbook/ Practical runnable examples
reference/ Compatibility matrix, feature matrix, error reference
security/ Security guidelines and troubleshooting
architecture/ Internal architecture documentation
ffi/ C ABI and FFI binding guide

Security

eggfetch follows a security-hardening program covering dependencies, TLS, redirects, auth, cookies, proxies, decompression, multipart, retries, and protocol handling.

  • Dependency auditing: cargo-deny configured in deny.toml
  • Secret redaction: All Debug/Display/error output redacts credentials, cookies, bearer tokens, and proxy passwords
  • Threat model: See docs/architecture/threat-model.md
  • Vulnerability reporting: See SECURITY.md

License

eggfetch is dual-licensed under MIT and Apache License, Version 2.0. You may use this project under either license.

MSRV

The minimum supported Rust version is 1.80. This is specified in workspace.package.rust-version and enforced by rust-toolchain.toml.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

eggfetch-0.1.1.tar.gz (346.9 kB view details)

Uploaded Source

Built Distributions

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

eggfetch-0.1.1-cp313-cp313-win_amd64.whl (3.4 MB view details)

Uploaded CPython 3.13Windows x86-64

eggfetch-0.1.1-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (3.6 MB view details)

Uploaded CPython 3.13manylinux: glibc 2.17+ x86-64

eggfetch-0.1.1-cp313-cp313-macosx_11_0_arm64.whl (3.3 MB view details)

Uploaded CPython 3.13macOS 11.0+ ARM64

eggfetch-0.1.1-cp312-cp312-win_amd64.whl (3.4 MB view details)

Uploaded CPython 3.12Windows x86-64

eggfetch-0.1.1-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (3.6 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.17+ x86-64

eggfetch-0.1.1-cp312-cp312-macosx_11_0_arm64.whl (3.3 MB view details)

Uploaded CPython 3.12macOS 11.0+ ARM64

eggfetch-0.1.1-cp311-cp311-win_amd64.whl (3.4 MB view details)

Uploaded CPython 3.11Windows x86-64

eggfetch-0.1.1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (3.6 MB view details)

Uploaded CPython 3.11manylinux: glibc 2.17+ x86-64

eggfetch-0.1.1-cp311-cp311-macosx_11_0_arm64.whl (3.3 MB view details)

Uploaded CPython 3.11macOS 11.0+ ARM64

eggfetch-0.1.1-cp310-cp310-win_amd64.whl (3.4 MB view details)

Uploaded CPython 3.10Windows x86-64

eggfetch-0.1.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (3.6 MB view details)

Uploaded CPython 3.10manylinux: glibc 2.17+ x86-64

eggfetch-0.1.1-cp310-cp310-macosx_11_0_arm64.whl (3.3 MB view details)

Uploaded CPython 3.10macOS 11.0+ ARM64

File details

Details for the file eggfetch-0.1.1.tar.gz.

File metadata

  • Download URL: eggfetch-0.1.1.tar.gz
  • Upload date:
  • Size: 346.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.14

File hashes

Hashes for eggfetch-0.1.1.tar.gz
Algorithm Hash digest
SHA256 ba9a4681856cf6cbb50f044b8dea17646b9cc7c5fa3cd7c4df7b37487cd39f72
MD5 51647a041956f4746a26d99731d3f203
BLAKE2b-256 4cde5dd87a68da324c533a6f02fafa0e7e5ec643cd3d6b515f7a067f684952a1

See more details on using hashes here.

Provenance

The following attestation bundles were made for eggfetch-0.1.1.tar.gz:

Publisher: pypi.yml on eggstack/eggfetch

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file eggfetch-0.1.1-cp313-cp313-win_amd64.whl.

File metadata

  • Download URL: eggfetch-0.1.1-cp313-cp313-win_amd64.whl
  • Upload date:
  • Size: 3.4 MB
  • Tags: CPython 3.13, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.14

File hashes

Hashes for eggfetch-0.1.1-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 10bb0162d3f03af6a9023ec5f07a92019d7e4028b2754883bcc2315cac637961
MD5 cee7020af313f997ce9a0f37f4459533
BLAKE2b-256 53b6003fe32c0cac23969adfd9c0674d7ae3e21069a205b45016afe04dd8aabd

See more details on using hashes here.

Provenance

The following attestation bundles were made for eggfetch-0.1.1-cp313-cp313-win_amd64.whl:

Publisher: pypi.yml on eggstack/eggfetch

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file eggfetch-0.1.1-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for eggfetch-0.1.1-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 de7eccff524be7d9e2fdf91e959185c3df93df7366f4a02395bf700da54147e6
MD5 46a823e4a9f9d878306801d3e7a866c4
BLAKE2b-256 2b11833d6b5b3cd788a8dec314a0caaf2e401a44346c3400d20d47c8e4f8df8e

See more details on using hashes here.

Provenance

The following attestation bundles were made for eggfetch-0.1.1-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl:

Publisher: pypi.yml on eggstack/eggfetch

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file eggfetch-0.1.1-cp313-cp313-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for eggfetch-0.1.1-cp313-cp313-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 882019fdfba208707a671e9dcb6f87dd8eaaf6ce483276bf8d533a25a30f60d7
MD5 b127de91f238863b969bc4e6f43dfad1
BLAKE2b-256 b418a29c088eecfbece2a7e0b0a05c8d7beaed47f79c3af9345a80155a7f1186

See more details on using hashes here.

Provenance

The following attestation bundles were made for eggfetch-0.1.1-cp313-cp313-macosx_11_0_arm64.whl:

Publisher: pypi.yml on eggstack/eggfetch

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file eggfetch-0.1.1-cp312-cp312-win_amd64.whl.

File metadata

  • Download URL: eggfetch-0.1.1-cp312-cp312-win_amd64.whl
  • Upload date:
  • Size: 3.4 MB
  • Tags: CPython 3.12, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.14

File hashes

Hashes for eggfetch-0.1.1-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 b949154f393628bf52495dff7cd6d834f84b172494726a308e01e8d0beaeed63
MD5 15240f64112b5030c15ac8cea1a69daf
BLAKE2b-256 a91d4c315a4e40962e1b16b187f7a97fc9bdea8436796ad265a78e173a736487

See more details on using hashes here.

Provenance

The following attestation bundles were made for eggfetch-0.1.1-cp312-cp312-win_amd64.whl:

Publisher: pypi.yml on eggstack/eggfetch

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file eggfetch-0.1.1-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for eggfetch-0.1.1-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 1da6864dc7fb5fda586566e86a41dbce34e4dabf4d0bc33595981a38d1e1285a
MD5 090dc377314d5385ac20ae073871db5d
BLAKE2b-256 c02cbefce070a31c4357aa50814d8af5b54e326d8b647a1d44b4aa7baf362810

See more details on using hashes here.

Provenance

The following attestation bundles were made for eggfetch-0.1.1-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl:

Publisher: pypi.yml on eggstack/eggfetch

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file eggfetch-0.1.1-cp312-cp312-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for eggfetch-0.1.1-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 9785b7aed172f1a107611ea619ada2df0fa8d0fab6be7c86bc226d1fb9c8c566
MD5 a9a6d933ba3b42df820c3abd44c8578f
BLAKE2b-256 461817e2ca3b4072336c6c286d7595fd4da3af786761cbed8e5ff7162f2843f0

See more details on using hashes here.

Provenance

The following attestation bundles were made for eggfetch-0.1.1-cp312-cp312-macosx_11_0_arm64.whl:

Publisher: pypi.yml on eggstack/eggfetch

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file eggfetch-0.1.1-cp311-cp311-win_amd64.whl.

File metadata

  • Download URL: eggfetch-0.1.1-cp311-cp311-win_amd64.whl
  • Upload date:
  • Size: 3.4 MB
  • Tags: CPython 3.11, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.14

File hashes

Hashes for eggfetch-0.1.1-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 b87e8e6f04427b2825dfde7edab9cf83fe1869ba9f39462c372cb31e7667a9cc
MD5 af444fbe5ac27f5d6b2d6c4ec3c7c89d
BLAKE2b-256 a012a1caff2816eaacb344cf51f3d780d21c4aae4086219e9beddeb5aa9da75c

See more details on using hashes here.

Provenance

The following attestation bundles were made for eggfetch-0.1.1-cp311-cp311-win_amd64.whl:

Publisher: pypi.yml on eggstack/eggfetch

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file eggfetch-0.1.1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for eggfetch-0.1.1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 61bfc911741c1b9dd2ff049c23a0d059c10e4886ce600eea22ab540494f66a98
MD5 1ceec63585fa43809d8df479f99cb42c
BLAKE2b-256 d2943b86e7461b29485b3be3ebacb82d917a8defb529bff65b7ed2e71c6214cb

See more details on using hashes here.

Provenance

The following attestation bundles were made for eggfetch-0.1.1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl:

Publisher: pypi.yml on eggstack/eggfetch

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file eggfetch-0.1.1-cp311-cp311-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for eggfetch-0.1.1-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 5741e58117b25518171afb2cfbf724461d1c476ed3e7102d1bcbc9779f983d69
MD5 9bd280454f99b5af39afe36d3fff3169
BLAKE2b-256 4a037208462c249a2baa4340dac25cd48201a9cff1e60a88e984cbb9e9debadb

See more details on using hashes here.

Provenance

The following attestation bundles were made for eggfetch-0.1.1-cp311-cp311-macosx_11_0_arm64.whl:

Publisher: pypi.yml on eggstack/eggfetch

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file eggfetch-0.1.1-cp310-cp310-win_amd64.whl.

File metadata

  • Download URL: eggfetch-0.1.1-cp310-cp310-win_amd64.whl
  • Upload date:
  • Size: 3.4 MB
  • Tags: CPython 3.10, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.14

File hashes

Hashes for eggfetch-0.1.1-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 3f4eaac367a2cfd88b893cdecb698a7989e5a00a5ebdfb702a0590ca9be2c807
MD5 f0e564119c352dd5fd9d4f20baa26bc5
BLAKE2b-256 b752abbb774e943238d8115ea447c9719545ef2779485da6867fe6dbd4ae2ade

See more details on using hashes here.

Provenance

The following attestation bundles were made for eggfetch-0.1.1-cp310-cp310-win_amd64.whl:

Publisher: pypi.yml on eggstack/eggfetch

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file eggfetch-0.1.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for eggfetch-0.1.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 b72c42c033bb469d9c869f846a0f745559b226c6167d92dc48792cf05fdae411
MD5 252b4109d8060aaedba6150b37d8d283
BLAKE2b-256 79f723568f4a47fd0d18772f343641139c7cc32cfb20215e23b384927b2a4060

See more details on using hashes here.

Provenance

The following attestation bundles were made for eggfetch-0.1.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl:

Publisher: pypi.yml on eggstack/eggfetch

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file eggfetch-0.1.1-cp310-cp310-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for eggfetch-0.1.1-cp310-cp310-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 9defd6b4f84c84806887230b4c1d44fd8342eca621b7fc796530299b1f5b8e9a
MD5 8103f8670a569cd90041c46a54e77c25
BLAKE2b-256 751ba2b71931907165ec33fd7084d53d917cf45b218fbb5b35540e26e7a0ffdb

See more details on using hashes here.

Provenance

The following attestation bundles were made for eggfetch-0.1.1-cp310-cp310-macosx_11_0_arm64.whl:

Publisher: pypi.yml on eggstack/eggfetch

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Release history Release notifications | RSS feed

0.1.4

13 files

0.1.3

13 files

This release

0.1.1 This release

13 files

0.1.0

13 files

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