Skip to main content

Stratus Python SDK

Control a local Stratus from tests and agents: wait for it, reset it, snapshot and roll back state, run seeded chaos, and ask why calls failed. Standard library only; Python 3.11+.

pip install stratus-emulator
import boto3
from stratus_emulator import StratusClient, StratusError

stratus = StratusClient()  # $STRATUS_ENDPOINT or http://localhost:4566
stratus.wait_until_ready()

s3 = boto3.client("s3", **stratus.boto3_kwargs())

# Everything created inside is rolled back afterwards, even on failure.
with stratus.snapshot_scope():
    run_my_test(s3)

# Fail the first PutItem, then recover; the experiment always stops.
spec = {"seed": 42, "rules": [{"service": "dynamodb", "operation": "PutItem", "action": "throttle", "max_hits": 1}]}
with stratus.chaos_experiment(spec) as run:
    run_my_test(s3)
print(run.report["total_injected"], run.report["recent_hits"])

# Why did things fail? Groups, likely cause, next step, and whether chaos did it.
print(stratus.diagnose(since="5m", exclude_injected=True)["summary"])
Method Control API
health(), is_ready(), wait_until_ready() GET /health, GET /ready
reset(*services) POST /reset
snapshots.create/list/get/restore/delete /snapshots
chaos.start/status/stop /chaos
diagnose(...) GET /diagnostics
snapshot_scope(), chaos_experiment(spec), boto3_kwargs(), aws_env() helpers

Every failure is a StratusError with a stable code (such as SnapshotNotFound), a hint and the HTTP status (0 when Stratus could not be reached). Responses are plain dicts, typed with TypedDicts in stratus_emulator.types.

pytest

Installing the package registers two fixtures:

  • stratus: a session-wide client, waited until ready.
  • stratus_isolated: the same client, with all state rolled back after the test.
def test_upload(stratus_isolated):
    s3 = boto3.client("s3", **stratus_isolated.boto3_kwargs())
    s3.create_bucket(Bucket="uploads")  # gone before the next test

Development

pip install -e . pytest && pytest tests
STRATUS_ENDPOINT=http://localhost:4566 pytest tests   # also runs the integration tests

Metadata

Release files for stratus-emulator 0.1.0

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

Source distribution (sdist)

Source distribution for stratus-emulator 0.1.0
File Size Uploaded Provenance Actions
stratus_emulator-0.1.0.tar.gz 20.7 kB With provenance Details for stratus_emulator-0.1.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for stratus-emulator 0.1.0
File Interpreter ABI Platform Actions
stratus_emulator-0.1.0-py3-none-any.whl Python 3 none any Details for stratus_emulator-0.1.0-py3-none-any.whl

Total release size: 38.0 kB

Release files / stratus_emulator-0.1.0.tar.gz

Download URL stratus_emulator-0.1.0.tar.gz
Size 20.7 kB
Tags Source
SHA-256 checksum
How to use checksums
95996eaadf612c4a076fd3759080792d44c18da9d6755fd5ecc5f8564c007394
BLAKE2b-256 checksum
How to use checksums
f07cdaa9e29f059ab79061161878569e00bff459d85d2d552fd86d88360fe770
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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 Nov 12, 2026.

Transparency log

Release files / stratus_emulator-0.1.0-py3-none-any.whl

Download URL stratus_emulator-0.1.0-py3-none-any.whl
Size 17.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
fee1b9e5f46582f9b35c23150fb847d4236287b8861c2218cc95fa78d70144e9
BLAKE2b-256 checksum
How to use checksums
e878078f59e096ad6e39c1f225db368daa96e7ee58569cb2e6a444777c3d19e1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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 Nov 12, 2026.

Transparency log

Security for stratus-emulator 0.1.0

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.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for stratus_emulator-0.1.0.tar.gz

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 Nov 12, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files Full provenance

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