Skip to main content

Tiny, dependency-free proxy SDK — one clean country/city/session/lifetime API for Aethyn residential proxies (and Bright Data, Oxylabs, Decodo, IPRoyal, SOAX, NetNut), ready for requests, httpx, Playwright and Selenium.

Project description

proxy-builder-sdk

A tiny, dependency-free Python SDK for aethyn.io residential proxies. Build correct proxy URLs with country / city / sticky-session / lifetime targeting and hand them straight to requests, httpx, Playwright, or Selenium — without hand-assembling fragile username strings.

pip install proxy-builder-sdk
import requests
from proxy_builder_sdk import AethynClient

client = AethynClient(username="aethyn-XXXXX", password="secret")   # or env AETHYN_USERNAME / AETHYN_PASSWORD

# rotating residential exit in the US
p = client.proxy(country="us")
r = requests.get("https://api.ipify.org?format=json", proxies=p.proxies)
print(r.json())

That's it. No hand-built aethyn-XXXXX-country-us-session-...-lifetime-... strings, no off-by-one dashes, no guessing the port.

Why

Aethyn encodes targeting inside the proxy username — country, city, ISP, a sticky-session id, and a lifetime. It's powerful but easy to get subtly wrong (a stray - in a session id silently corrupts the whole thing, and city/ISP only work on the Elite tier). This SDK gives you a typed, validated API and keeps the wire format an internal detail, so if Aethyn ever changes the username scheme, you just upgrade the package — your code doesn't move.

Usage

Sticky sessions

Hold the same exit IP for a multi-step flow (login → cart → checkout):

p = client.session(country="de", session="cart42", ttl=10)   # same IP for 10 minutes
# p.username -> "aethyn-XXXXX-country-de-session-cart42-lifetime-10"

ttl is minutes (1–1440). Leave session off for per-request rotation (the default).

City / ISP targeting (Elite tier)

p = client.session(country="us", city="chicago", isp="comcast",
                   session="run1", ttl=30, tier="elite")

city, state, isp, and zip are Elite-only — the SDK raises a clear error if you pass them on Premium.

httpx

import httpx
p = client.proxy(country="gb")
with httpx.Client(proxy=p.url) as http:
    http.get("https://example.com")

Playwright

from playwright.sync_api import sync_playwright
p = client.session(country="fr", session="s1", ttl=15, tier="elite")
with sync_playwright() as pw:
    browser = pw.chromium.launch(proxy=p.for_playwright())
    ...

Selenium (via SeleniumWire) & SOCKS5

p = client.proxy(country="jp", protocol="socks5")   # -> socks5://...@proxy.aethyn.io:1099

What you get back

p = client.session(country="us", session="run1", ttl=10)
p.username        # "aethyn-XXXXX-country-us-session-run1-lifetime-10"
p.host, p.port    # ("proxy.aethyn.io", 2099)
p.url             # "http://aethyn-XXXXX-...:secret@proxy.aethyn.io:2099"
p.proxies         # {"http": ..., "https": ...}  -> requests/httpx `proxies=`
p.for_playwright()# {"server": ..., "username": ..., "password": ...}
str(p)            # password-redacted, safe to log

Ports are picked for you: Premium 2099 (HTTP) / 1099 (SOCKS5), Elite 5499 (HTTP) / 3499 (SOCKS5). Self-hosting or white-labeling? Pass AethynClient(..., host="gate.example.com").

Other providers

Aethyn is the default, but the same clean API drives other big residential providers too — use ProxyClient with a provider:

from proxy_builder_sdk import ProxyClient

# Oxylabs — the SDK emits customer-...-cc-us-sessid-run1-sesstime-10
p = ProxyClient(username="customer-me", password="pw", provider="oxylabs").session(
    country="us", session="run1", ttl=10
)
provider gateway notes
aethyn (default) proxy.aethyn.io Premium/Elite tiers, city/ISP/state/zip
brightdata brd.superproxy.io pass brd-customer-<id>-zone-<zone> as the username
oxylabs pr.oxylabs.io cc/sessid/sesstime; state as us_california
smartproxy / decodo gate.decodo.com sessionduration (minutes)
iproyal geo.iproyal.com targeting goes in the password
soax proxy.soax.com ⚠️ community-verified; lifetime in seconds
netnut gw.netnut.net country + sticky session only

Every non-Aethyn dialect was verified against the provider's official docs (each provider file records the source URL + a confidence level). soax is medium confidence — sanity-check it against SOAX's current docs before you lean on it. Each provider maps the same semantic call (country, city, state, session, ttl) to its own username/password format and raises a clear error for anything it can't express.

Adding another proxy provider

Contributions of new providers are welcome. Most providers are a ~12-line dialect config — drop a file in src/proxy_builder_sdk/providers/, register it, and open a PR:

from proxy_builder_sdk.providers.dialect import DialectProvider
from proxy_builder_sdk.providers.base import register_provider

register_provider(DialectProvider(
    name="myprovider", display="My Provider",
    host="gateway.myprovider.com", http_port=8000, socks5_port=None,
    auth_in="username", delim="-",
    keys={"country": "cc", "session": "sess", "ttl": "ttl"},  # our param -> their keyword
    order=["country", "session", "ttl"],
    source="https://docs.myprovider.com/...", confidence="high",
))

For anything that doesn't fit the dialect model, implement the one-method Provider protocol directly. See CONTRIBUTING.md for the full walkthrough and PR checklist.

Links

License

MIT

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

proxy_builder_sdk-0.2.0.tar.gz (15.6 kB view details)

Uploaded Source

Built Distribution

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

proxy_builder_sdk-0.2.0-py3-none-any.whl (17.7 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: proxy_builder_sdk-0.2.0.tar.gz
  • Upload date:
  • Size: 15.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for proxy_builder_sdk-0.2.0.tar.gz
Algorithm Hash digest
SHA256 a37517114554328b4c83dc8127b9f5ffb7342d80cecacc86eade1dca3d48c912
MD5 a08eca9ceda01a044d57ac0a97a8486d
BLAKE2b-256 f61f0d5a8199e5a535eaa9c4296dbdad5a130f94c895e052d62d504819a542a8

See more details on using hashes here.

Provenance

The following attestation bundles were made for proxy_builder_sdk-0.2.0.tar.gz:

Publisher: publish.yml on aethynio/proxy-builder-sdk-python

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

File details

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

File metadata

File hashes

Hashes for proxy_builder_sdk-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 5db995ebfdd13c5491aa84d7ea602eba8a4440a4b95adeb78108625b96813ebb
MD5 a4c1568594b9c2ed6d4d2c591e2543e7
BLAKE2b-256 57327d7b1d3290be8ac0c94fefffab185d0b215165802d03d71898b82c9f92e1

See more details on using hashes here.

Provenance

The following attestation bundles were made for proxy_builder_sdk-0.2.0-py3-none-any.whl:

Publisher: publish.yml on aethynio/proxy-builder-sdk-python

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

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