skillfed

dub

Python Client SDK Generated by Speakeasy

dub v0.37.1 249.6K downloads/30d#8,649 on PyPI8
License unclear Active released

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 dub

uv

uv add dub

poetry

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 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

Programming Language :: Python :: 3Programming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.14

Tags

link shortening sdkurl attribution trackingaffiliate program apiconversion tracking pythondub.co api clientshort link managementlink analytics api
link-trackingaffiliate-marketingapi-client

More WWW/HTTP packages