High-performance CPython HTTP client with browser impersonation.
Project description
Gakido
High-performance CPython HTTP client focused on browser impersonation, anti-bot evasion, and speed.
Features
- Browser profiles (Chrome/Firefox/Safari/Edge/Tor aliases)
- JA3/Akamai-style TLS overrides (
tls_configuration_options,ExtraFingerprints) - HTTP/1.1, HTTP/2, and HTTP/3 (QUIC) support
- HTTP/3 optimized for Cloudflare and CDN targets
- Automatic compression (gzip, deflate, brotli) with profile-based Accept-Encoding
- Sync + async clients, connection pooling
- Multipart uploads
- Minimal WebSocket client
- Optional native HTTP fast-path (
gakido_core, HTTP only) - 96 browser profiles (24 base + 72 aliases) for Chrome, Firefox, Safari, Edge, Opera, Brave, Vivaldi, Tor
- Antibot benchmark for testing impersonation against detection systems
Install
pip:
pip install gakido
pip install gakido[h3] # with HTTP/3 support
pip install gakido[dev] # development dependencies
uv:
uv add gakido
uv add gakido[h3] # with HTTP/3 support
uv add gakido[dev] # development dependencies
Quick start (sync)
from gakido import Client
c = Client(impersonate="chrome_120") # force_http1 defaults to True
r = c.get("https://example.com")
print(r.status_code, r.text[:200])
Async
import asyncio
from gakido.aio import AsyncClient
async def main():
async with AsyncClient(impersonate="chrome_120") as c:
r = await c.get("https://httpbin.org/get")
print(r.status_code)
asyncio.run(main())
Multipart upload
files = {"file": ("test.txt", b"hello", "text/plain")}
data = {"foo": "bar"}
with Client() as c:
r = c.post("https://httpbin.org/post", data=data, files=files)
print(r.json())
TLS overrides (JA3-like)
from gakido import Client, ExtraFingerprints
ja3_str = "771,4866-4867-4865-49196,0-11-10,29,0"
extra_fp = ExtraFingerprints(alpn=["http/1.1"])
c = Client(
impersonate="chrome_120",
tls_configuration_options={"ja3_str": ja3_str, "extra_fp": extra_fp},
)
r = c.get("https://tls.browserleaks.com/json")
print(r.json().get("ja3_hash"))
WebSocket
from gakido.websocket import WebSocket
ws = WebSocket.connect("echo.websocket.events", 443, "/", headers=[], tls=True)
ws.send_text("hello")
op, payload = ws.recv()
print(payload.decode(errors="ignore"))
ws.close()
Proxies
gakido supports HTTP, SOCKS5, and SOCKS5H proxies for both sync and async clients.
from gakido import Client, AsyncClient
# Sync client with HTTP or SOCKS5 proxy
c = Client()
r = c.get("http://httpbin.org/ip", proxy="http://127.0.0.1:8080")
r = c.get("http://httpbin.org/ip", proxy="socks5://127.0.0.1:1080")
r = c.get("http://httpbin.org/ip", proxy="socks5h://user:pass@127.0.0.1:1080") # proxy resolves hostname
print(r.text)
# Async client with proxy pool
async_client = AsyncClient(proxy_pool=[
"http://proxy1:8080",
"socks5://proxy2:1080",
"socks5h://user:pass@proxy3:1080",
])
r = await async_client.get("http://httpbin.org/ip")
print(r.text)
Retry with Exponential Backoff
gakido supports configurable retry with exponential backoff for both sync and async clients.
from gakido import Client, AsyncClient
import time
# Sync client with retry
client = Client(
max_retries=3, # Up to 3 retry attempts (4 total attempts)
retry_base_delay=0.5, # Start with 0.5s delay
retry_max_delay=30.0, # Cap delay at 30s
retry_jitter=True, # Add random jitter to avoid thundering herd
)
try:
resp = client.get("http://flaky.example.com")
except Exception as e:
print(f"Failed after retries: {e}")
# Async client with retry
async_client = AsyncClient(
max_retries=2,
retry_base_delay=1.0,
retry_jitter=False, # Predictable delays for testing
)
resp = await async_client.get("http://api.example.com")
# Retryable status codes (by default): 408, 429, 500, 502, 503, 504, 507, 511
# Retryable exceptions (by default): ConnectionError, TimeoutError, OSError
See [Retry Documentation](docs/retry.md) for detailed information about retry options and best practices.
HTTP/3 (QUIC) for Cloudflare/CDN
import asyncio
from gakido import AsyncClient, is_http3_available
async def main():
print(f"HTTP/3 available: {is_http3_available()}")
async with AsyncClient(
impersonate="chrome_120",
http3=True, # Enable HTTP/3
http3_fallback=True, # Fall back to H1/H2 if H3 fails
) as c:
r = await c.get("https://cloudflare.com/cdn-cgi/trace")
print(f"HTTP/{r.http_version}: {r.status_code}")
asyncio.run(main())
Notes
force_http1=Trueby default for compatibility; setforce_http1=Falseto allow ALPN h2.http3=Trueenables HTTP/3 (QUIC) for compatible targets (requirespip install gakido[h3]).auto_decompress=Trueby default: uses profile's Accept-Encoding (gzip, deflate, br) and auto-decompresses responses.- Set
auto_decompress=Falseto disable compression and receive raw responses. - Native core (
gakido_core) is HTTP-only; HTTPS still uses the Python path.
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
Built Distributions
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file gakido-0.1.4.tar.gz.
File metadata
- Download URL: gakido-0.1.4.tar.gz
- Upload date:
- Size: 85.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
67eeb10ce46dfa2fc05ebbd82a3bb747b16ba0cfcb1d3c7667284d2057b097ac
|
|
| MD5 |
2cbe4d7dd7e5ffb88e417455325696cd
|
|
| BLAKE2b-256 |
39341fd2640f87b89f9ba9d4ca9fa2a739c9b5fd664a010c854b3c03a1a3782d
|
File details
Details for the file gakido-0.1.4-cp313-cp313-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl.
File metadata
- Download URL: gakido-0.1.4-cp313-cp313-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl
- Upload date:
- Size: 79.3 kB
- Tags: CPython 3.13, manylinux: glibc 2.28+ x86-64, manylinux: glibc 2.5+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
461394e653759f1b0072d6c23b83ebb3331eb67aaba6ad1dd9bd72ccf2d20a45
|
|
| MD5 |
b7e56ef4e06aaca0b61a583d63d93cc9
|
|
| BLAKE2b-256 |
c8c1407f713ecacc023af7236382a8b48d593041afd7c6474547e2893c0f93bc
|
File details
Details for the file gakido-0.1.4-cp313-cp313-macosx_11_0_arm64.whl.
File metadata
- Download URL: gakido-0.1.4-cp313-cp313-macosx_11_0_arm64.whl
- Upload date:
- Size: 61.0 kB
- Tags: CPython 3.13, macOS 11.0+ ARM64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
52390367e55dd9165af3da6c95e095212764262e49c58dacd559f69e7d5ddb85
|
|
| MD5 |
031b1d70d07e8e6f8cf441c898e27e86
|
|
| BLAKE2b-256 |
bc4a97c7188dfbdcbdac8f58902a292ecaaca2d5de8296e7a0dfe359dc6f214c
|
File details
Details for the file gakido-0.1.4-cp312-cp312-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl.
File metadata
- Download URL: gakido-0.1.4-cp312-cp312-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl
- Upload date:
- Size: 79.3 kB
- Tags: CPython 3.12, manylinux: glibc 2.28+ x86-64, manylinux: glibc 2.5+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7e8baa4f6e781471bc32204414111961d4238e32c2a4e12e5dd9f0963eb46c36
|
|
| MD5 |
37ee8ed50eb611dc57bae154d7fb96d6
|
|
| BLAKE2b-256 |
466c5c26247752d4266936ce1b3a1761e51aeb5ced9ca866adc55a903807f634
|
File details
Details for the file gakido-0.1.4-cp312-cp312-macosx_11_0_arm64.whl.
File metadata
- Download URL: gakido-0.1.4-cp312-cp312-macosx_11_0_arm64.whl
- Upload date:
- Size: 61.0 kB
- Tags: CPython 3.12, macOS 11.0+ ARM64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5f5996a9a11a3b042d88fd2693e92be891e961c9acc5716ac1b69d9de69c3287
|
|
| MD5 |
0d37f3633ab09ec4c04b69fa10912294
|
|
| BLAKE2b-256 |
b9b7680b07945feaf4cf861a634900dbb68203bfe181d8e3a93aa1d9af74b071
|
File details
Details for the file gakido-0.1.4-cp311-cp311-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl.
File metadata
- Download URL: gakido-0.1.4-cp311-cp311-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl
- Upload date:
- Size: 77.1 kB
- Tags: CPython 3.11, manylinux: glibc 2.28+ x86-64, manylinux: glibc 2.5+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8aefd3d9d4fd8136eb280fbf6037cd8326a24cf148b27c1a5e4178a930d1bfe7
|
|
| MD5 |
caf9bdab68574d4cdd67b6aa23e09cb4
|
|
| BLAKE2b-256 |
2d6891fb8c033ecb65a6da65a4acb000ab02a4f8752a38f34f5d75596e44eef0
|
File details
Details for the file gakido-0.1.4-cp311-cp311-macosx_11_0_arm64.whl.
File metadata
- Download URL: gakido-0.1.4-cp311-cp311-macosx_11_0_arm64.whl
- Upload date:
- Size: 61.1 kB
- Tags: CPython 3.11, macOS 11.0+ ARM64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
30597d10ebc7676d703c18831c4ce97378e0d1b88822d16bfb3e4e69f666259c
|
|
| MD5 |
11bfad11d719c26db632dd1bc6ff9d7f
|
|
| BLAKE2b-256 |
19bf37aeaba9ac1c64576efc045d2cdd5f5bd16f153fc467a1342dfffdc2b830
|