Python SDK for in-process load execution, traffic correlation, and reporting.
Project description
LoadStrike SDK for Python
LoadStrike is a developer-first load testing SDK for Python services, jobs, and automated test suites. Use it to describe real workflows in Python, execute them in-process, and collect structured reports from the same codebase that owns the system under test.
What This SDK Is For
- Author scenario-based load tests in Python.
- Generate safe starter scenarios from captured HAR, OpenTelemetry trace JSON, browser recordings, or message pairs with Trace-to-test Autopilot.
- Model transaction flows across HTTP and event-driven systems.
- Apply load simulations, thresholds, and custom metrics during execution.
- Generate local reports and, on Business and Enterprise, forward results to supported reporting sinks.
Built-in transport coverage includes HTTP, Kafka, RabbitMQ, NATS, Redis Streams, Azure Event Hubs, Push Diffusion, and delegate-based custom streams. Local report output supports HTML, Markdown, TXT, and CSV, and Business and Enterprise can publish to InfluxDB, TimescaleDB, Grafana Loki, Datadog, Splunk HEC, and OpenTelemetry Collector.
Requirements
- Python 3.9 or later
Install
pip install loadstrike
Quick Start
from loadstrike_sdk import (
LoadStrikeResponse,
LoadStrikeRunner,
LoadStrikeScenario,
LoadStrikeSimulation,
LoadStrikeStep,
)
def run_orders(context):
return LoadStrikeStep.run(
"publish-order",
context,
lambda: LoadStrikeResponse.ok("200"),
).as_reply()
scenario = (
LoadStrikeScenario.create("orders", run_orders)
.with_load_simulations(LoadStrikeSimulation.inject(10, 1, 20))
)
result = (
LoadStrikeRunner.register_scenarios(scenario)
.with_runner_key("rkl_your_runner_key")
.run()
)
run() returns the detailed run result, including generated report files, scenario statistics, metrics, and sink status.
Trace-To-Test Autopilot
Use LoadStrikeAutopilot.generate(...) to infer a starter plan from a captured artifact. Check result.Readiness and result.ReadinessFailures first; call result.build_scenario() only when it is LoadStrikeAutopilotReadiness.Ready, then execute the scenario through the normal runner with a valid RunnerKey.
Use SecretBindings to map redaction locations such as header:Authorization or body:$.client_secret to environment variables, TrackingSelector when the selector cannot be inferred, and EndpointBindings, AllowedReplayHosts, or BaseUrlRewrite when a replay target must be bound. Secret values are resolved when the generated scenario runs; they are not written into the generated plan. Any gate satisfied by user setup is omitted from ReadinessFailures.
Runner Keys
Runnable workloads require a RunnerKey. Supply it with .with_runner_key(...) or through your application configuration before calling run().
Documentation
- Product documentation: https://loadstrike.com/documentation
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file loadstrike-1.0.22001.tar.gz.
File metadata
- Download URL: loadstrike-1.0.22001.tar.gz
- Upload date:
- Size: 577.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6a64f53da03ee575ea505e3b41712d34f296c4f1865ec2828245ae4477441d61
|
|
| MD5 |
b06edd274e0155551968966e91497d81
|
|
| BLAKE2b-256 |
d3d5714ca2e688ee2e16d916f5f2dd35c0057f9226ca287376832a01bd548794
|
Provenance
The following attestation bundles were made for loadstrike-1.0.22001.tar.gz:
Publisher:
main-delivery.yml on Meticulis/LoadStrike
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
loadstrike-1.0.22001.tar.gz -
Subject digest:
6a64f53da03ee575ea505e3b41712d34f296c4f1865ec2828245ae4477441d61 - Sigstore transparency entry: 1395255419
- Sigstore integration time:
-
Permalink:
Meticulis/LoadStrike@f05ebab440b7a9cede44d2af1f13b4713523e979 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/Meticulis
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
main-delivery.yml@f05ebab440b7a9cede44d2af1f13b4713523e979 -
Trigger Event:
workflow_dispatch
-
Statement type:
File details
Details for the file loadstrike-1.0.22001-py3-none-any.whl.
File metadata
- Download URL: loadstrike-1.0.22001-py3-none-any.whl
- Upload date:
- Size: 582.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d158ae4bdf4be8edaf51db8dec8c866b0832a60939d4b964278aa22734cd2a65
|
|
| MD5 |
663e9fc987a507fe2caeb77d5fde4998
|
|
| BLAKE2b-256 |
80f713fab60efe0e5f174c6fc741bf203f67bf6120859c2addda585890931041
|
Provenance
The following attestation bundles were made for loadstrike-1.0.22001-py3-none-any.whl:
Publisher:
main-delivery.yml on Meticulis/LoadStrike
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
loadstrike-1.0.22001-py3-none-any.whl -
Subject digest:
d158ae4bdf4be8edaf51db8dec8c866b0832a60939d4b964278aa22734cd2a65 - Sigstore transparency entry: 1395255421
- Sigstore integration time:
-
Permalink:
Meticulis/LoadStrike@f05ebab440b7a9cede44d2af1f13b4713523e979 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/Meticulis
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
main-delivery.yml@f05ebab440b7a9cede44d2af1f13b4713523e979 -
Trigger Event:
workflow_dispatch
-
Statement type: