Skip to main content

Python SDK for Tusk Drift instrumentation and replay

Project description

Tusk Drift Banner

PyPI version License: Apache 2.0 GitHub last commit 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.12+

Tusk Drift currently supports the following packages and versions:

  • Flask: flask>=2.0.0
  • FastAPI: fastapi>=0.68.0
  • Django: django>=3.2.0
  • Requests: requests (all versions)
  • HTTPX: httpx (all versions)
  • psycopg: psycopg>=3.0.0, psycopg2>=2.8.0
  • Redis: redis (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 and configure the Tusk Drift CLI by following our CLI installation guide. The CLI helps set up your Tusk configuration file and replays tests.

The wizard will eventually direct you back here when it's time to set up the SDK.

Step 2: Install the SDK

After completing the CLI wizard, install the SDK:

pip install tusk-drift-python-sdk

With Framework Support

# With Flask support
pip install tusk-drift-python-sdk[flask]

# With FastAPI support
pip install tusk-drift-python-sdk[fastapi]

# With Django support
pip install tusk-drift-python-sdk[django]

Step 3: Initialize the SDK for your service

Refer to our initialization guide to set up the SDK for your service.

Step 4: Run Your First Test

Follow along our quick start guide to record and replay your first test!

Troubleshooting

Having issues?

Community

Join our open source community on Slack.

Contributing

We appreciate feedback and contributions. See CONTRIBUTING.md.

License

This project is licensed under the Apache License 2.0 - see the LICENSE file for details.

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

tusk_drift_python_sdk-0.1.8.tar.gz (155.8 kB view details)

Uploaded Source

Built Distribution

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

tusk_drift_python_sdk-0.1.8-py3-none-any.whl (185.0 kB view details)

Uploaded Python 3

File details

Details for the file tusk_drift_python_sdk-0.1.8.tar.gz.

File metadata

  • Download URL: tusk_drift_python_sdk-0.1.8.tar.gz
  • Upload date:
  • Size: 155.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for tusk_drift_python_sdk-0.1.8.tar.gz
Algorithm Hash digest
SHA256 ef78ee9bfdea0febed0b01bbf10bf20a901cbb4966886ce91dbafb0eb8260152
MD5 8d7e58eb958bc1ca9f9aa51d38886161
BLAKE2b-256 38cca9be769e1fdd1ed78f8051fd8150e49acd2a1fdcd5aedb78fb4e1f550c05

See more details on using hashes here.

Provenance

The following attestation bundles were made for tusk_drift_python_sdk-0.1.8.tar.gz:

Publisher: publish-python-sdk.yml on Use-Tusk/drift-python-sdk

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

File details

Details for the file tusk_drift_python_sdk-0.1.8-py3-none-any.whl.

File metadata

File hashes

Hashes for tusk_drift_python_sdk-0.1.8-py3-none-any.whl
Algorithm Hash digest
SHA256 a9a9fdf8780ed3b9f4c0ccc361ec7235b85b8a4c5fbe6a9df34b8de3e2bb3d49
MD5 b2a10e991f61780c3a20eac27471e759
BLAKE2b-256 57ab320cfbf9e0dfb68bcf207b7343c9c71ea11c2da3cedcf1e63d994be24b00

See more details on using hashes here.

Provenance

The following attestation bundles were made for tusk_drift_python_sdk-0.1.8-py3-none-any.whl:

Publisher: publish-python-sdk.yml on Use-Tusk/drift-python-sdk

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