dub
Python Client SDK Generated by Speakeasy
What it is and what it does
Dub is an official Python client for the Dub.co API, a link attribution and conversion tracking platform. It wraps Dub's REST API to let you create short links, manage tags and domains, retrieve analytics, handle affiliate commissions, and run A/B tests on link variants—all from Python code. The SDK supports both synchronous and asynchronous workflows via context managers, and uses pydantic for request/response validation and httpx for HTTP transport.
The package targets Python 3.10 and later. It depends on httpcore, httpx, jsonpath-python, and pydantic. Installation is straightforward via pip, uv, or poetry, and the SDK is designed to work with Dub API authentication tokens. It includes built-in support for retries, pagination, custom HTTP clients, and error handling.
Use it for:
- Create and manage short links programmatically for marketing campaigns or affiliate tracking.
- Retrieve click and conversion analytics for links to measure campaign performance.
- Manage affiliate commissions and bounty submissions within your application.
- Run A/B tests by creating link variants with specified traffic percentages.
- Integrate Dub link tracking into a backend service or automation workflow.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Dub is a Python SDK for the Dub.co link attribution platform, providing programmatic access to create, manage, and track short links, conversion data, and affiliate programs.
Yes, if you use Dub.co for link management or affiliate tracking and need programmatic access from Python. The package is actively maintained, has low install friction, and supports current Python versions. However, verify the license terms before use in commercial or compliance-sensitive projects, since the license status is currently unclear in the metadata.
Install
dub on PyPI
pip
pip install dubuv
uv add dubpoetry
poetry add dubInstalling dub
Before you install
Low install friction with a pure-Python wheel distribution. The package is actively maintained with a recent release (40 days old) and supports current Python versions (3.10–3.14). Four runtime dependencies (httpcore, httpx, jsonpath-python, pydantic) are all stable, widely-used libraries.
License in practice
License status is unclear—no SPDX identifier or raw license text is declared in the package metadata. Before adopting in a commercial or compliance-sensitive context, verify the actual license terms directly from the repository.
Quickstart
pip install dub
from dub import Dub
with Dub(token="DUB_API_KEY") as client:
res = client.links.create(request={
"url": "https://google.com",
"external_id": "123456"
})
print(res)
Requires Python 3.10 or later and a valid Dub API token.
Verify before relying
- Whether the package is generated by Speakeasy tooling and how that affects maintenance or API stability guarantees.
- Actual license terms, given the unclear license_treatment in metadata.
Package facts
| License | not declared (unclear) |
| Python support | supports the current Python release (>=3.10) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 4 — httpcore, httpx, jsonpath-python, pydantic |
| Maintenance | actively maintained — 40 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 249,563/month — #8,649 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: dub-0.37.1-py3-none-any.whl
Tags
More WWW/HTTP packages
urllib3 is an HTTP client library that provides…
permissive · top 100 on PyPI
requestsRequests is a Python HTTP library that…
permissive · top 100 on PyPI
h11h11 is a pure-Python HTTP/1.1 protocol…
permissive · top 100 on PyPI
httpxHTTPX is a fully featured HTTP client library…
permissive · top 100 on PyPI
httpcoreA minimal low-level HTTP client library that…
permissive · top 100 on PyPI
aiohttpaiohttp is an async HTTP client and server…
permissive · top 100 on PyPI
airbyte-apiPython SDK for programmatically controlling…
unclear · top 5,000 on PyPI
polar-sdkPython SDK for interacting with the Polar API,…
permissive · top 15,000 on PyPI
Pinterest-Generated-ClientProvides auto-generated Python bindings for…
permissive · top 15,000 on PyPI
novu-pyA Python SDK for interacting with Novu's…
unclear · top 15,000 on PyPI
cybrid-api-id-pythonGenerated Python client for the Cybrid Identity…
permissive · top 15,000 on PyPI
sumologic-sdkPython interface to the Sumo Logic REST API,…
permissive · top 15,000 on PyPI
Unified-python-sdkPython SDK client for the Unified.to API,…
unclear · top 15,000 on PyPI
cybrid-api-organization-pythonA Python client library for the Cybrid…
permissive · top 15,000 on PyPI
cybrid-api-bank-pythonPython client library for the Cybrid Bank API,…
permissive · top 15,000 on PyPI
stripeProvides Python bindings to the Stripe API,…
permissive · top 1,000 on PyPI