--- id: dub version: "0.37.1" license: unclear license_treatment: unclear maintenance: active --- # dub — Python Client SDK Generated by Speakeasy License: unclear · Maintenance: active · Downloads: 249.6K/mo ## 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 above — 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 pip install dub uv add dub poetry add dub ## Installing 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_current - Install friction: low - Maintenance: active - Downloads: 249.6K/month (top 15,000 on PyPI) - Known vulnerabilities: none known ## Tags link shortening sdk, url attribution tracking, affiliate program api, conversion tracking python, dub.co api client, short link management, link analytics api, link-tracking, affiliate-marketing, api-client [View on SkillFed](https://skillfed.io/packages/dub) · [View on PyPI](https://pypi.org/project/dub/)