Skip to main content

Tusk Drift Banner

PyPI version PyPI - Python Version License: Apache 2.0 Tusk X account Tusk Community Slack

The Python Tusk Drift SDK enables fast and deterministic API testing by capturing and replaying API calls made to/from your service. Automatically record real-world API calls, then replay them as tests using the Tusk CLI to find regressions. During replay, all outbound requests are intercepted with recorded data to ensure consistent behavior without side-effects.

Documentation

For comprehensive guides and API reference, visit our full documentation.

SDK Guides

Tusk Drift Animated Diagram Tusk Drift Animated Diagram

Requirements

  • Python 3.9+

Tusk Drift currently supports the following packages and versions:

Package Supported Versions
Flask >=2.0.0
FastAPI >=0.68.0
Django >=3.2.0
Requests all versions
HTTPX all versions
aiohttp all versions
urllib3 all versions
grpcio (client-side only) all versions
psycopg >=3.1.12
psycopg2 all versions
SQLAlchemy all versions
Redis >=4.0.0
Kinde >=2.0.1
PyJWT all versions
urllib.request all versions

If you're using packages or versions not listed above, please create an issue with the package + version you'd like an instrumentation for.

Installation

Step 1: Install the CLI

First, install the Tusk Drift CLI by following our CLI installation guide.

Step 2: Set up Tusk Drift

AI-powered setup (recommended)

Use our AI agent to automatically set up Tusk Drift for your service:

cd path/to/your/service
export ANTHROPIC_API_KEY=your-api-key
tusk drift setup

The agent will analyze your codebase, install the SDK, instrument it into your application, create configuration files, and test the setup with recording and replay.

Manual setup

Alternatively, you can set up Tusk Drift manually:

  1. Install the SDK:

    # Use Rust bindings for better performance
    pip install tusk-drift-python-sdk[rust]
    
    # Fallback if no platform-compatible wheel
    pip install tusk-drift-python-sdk
    

    For more information about Rust acceleration, refer to this doc.

  2. Create configuration: Run tusk init to create your .tusk/config.yaml config file interactively, or create it manually per the configuration docs.

  3. Initialize the SDK: Refer to the initialization guide to instrument the SDK in your service.

  4. Record and replay: Follow the quick start guide to record and replay your first test!

Troubleshooting

Having issues?

Community

Join our open source community on Slack.

Metadata

Release files for tusk-drift-python-sdk 0.1.29

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for tusk-drift-python-sdk 0.1.29
File Size Uploaded
tusk_drift_python_sdk-0.1.29.tar.gz 299.7 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for tusk-drift-python-sdk 0.1.29
File Interpreter ABI Platform
tusk_drift_python_sdk-0.1.29-py3-none-any.whl Python 3 none any Details

Total release size: 657.4 kB

Release files / tusk_drift_python_sdk-0.1.29.tar.gz

Download URL tusk_drift_python_sdk-0.1.29.tar.gz
Size 299.7 kB
Tags Source
SHA-256 checksum
How to use checksums
88aab1cf4fd9a54e09e93bb4f815dab2307c269c548efd8f79ff9e3ef004ea1d
BLAKE2b-256 checksum
How to use checksums
4a0a6bdf7eecb913a00997378f7d2559fc6d86497b96c78a5c1d6dc4d7088f3b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on May 8, 2026.

Transparency log

Release files / tusk_drift_python_sdk-0.1.29-py3-none-any.whl

Download URL tusk_drift_python_sdk-0.1.29-py3-none-any.whl
Size 357.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
d077ae002297ab11c2111e81cc08545661f635e43e1e30f5c287a7942b757acd
BLAKE2b-256 checksum
How to use checksums
89818f85e92f1ef9cc1b3328390d789b86521e9810d00ff959e6198b72ed304c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on May 8, 2026.

Transparency log
Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page