Skip to main content

testcontainers-rustfs

Unofficial Testcontainers Python module for RustFS, an S3-compatible object store.

Not affiliated with or endorsed by the RustFS or Testcontainers projects.

Install

Requires Python 3.14 or newer.

pip install 'testcontainers-rustfs[boto3]'

The boto3 extra is optional. Without it the container still starts and get_config() / get_url() work; only get_client() requires boto3.

Usage

from testcontainers_rustfs import RustfsContainer

with RustfsContainer() as rustfs:
    client = rustfs.get_client()
    client.create_bucket(Bucket="testbucket")
    client.put_object(Bucket="testbucket", Key="hello.txt", Body=b"Hello RustFS")

    stored = client.get_object(Bucket="testbucket", Key="hello.txt")["Body"].read()

Bucket names must be 3–63 characters — RustFS rejects shorter names with InvalidBucketName.

Bringing your own client

with RustfsContainer() as rustfs:
    config = rustfs.get_config()
    # {'endpoint': 'localhost:32768', 'endpoint_url': 'http://localhost:32768',
    #  'access_key': 'rustfsadmin', 'secret_key': 'rustfsadmin', 'region_name': 'us-east-1'}

endpoint is the host:port form some SDKs expect; endpoint_url is the full URL boto3 wants.

Web console

Disabled by default. Enable it to inspect a failing test's data by eye:

with RustfsContainer(console=True) as rustfs:
    print(rustfs.get_console_url())

get_console_url() raises RuntimeError if the console was not enabled.

Configuration

Parameter Default Description
image rustfs/rustfs:1.0.0 Docker image. Pinned deliberately — :latest moves often
port 9000 Container port serving the S3 API
access_key rustfsadmin Access key for client connections
secret_key rustfsadmin Secret key for client connections
console False Enable and expose the web console (keyword-only)
console_port 9001 Container port serving the console (keyword-only)
region_name us-east-1 Region reported to S3 clients (keyword-only)

Any further keyword arguments are passed through to DockerContainer.

Credentials and region are always passed explicitly to the boto3 client, so your ~/.aws/config never influences test behaviour.

Development

make install-dev
make test      # lint + unit
make coverage

Tests require a running Docker daemon.

Metadata

Release files for testcontainers-rustfs 1.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 testcontainers-rustfs 1.1.0
File Size Uploaded
testcontainers_rustfs-1.1.0.tar.gz 5.4 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for testcontainers-rustfs 1.1.0
File Interpreter ABI Platform
testcontainers_rustfs-1.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 10.8 kB

Release files / testcontainers_rustfs-1.1.0.tar.gz

Download URL testcontainers_rustfs-1.1.0.tar.gz
Size 5.4 kB
Tags Source
SHA-256 checksum
How to use checksums
4ba7c192e6e2bc4ccedd60053c17a83456ee9cbd9d34103e4ab65169f7402ddd
BLAKE2b-256 checksum
How to use checksums
c01c55b93549eae9863189ec8cab4eec98c0629465f4b66b5259c1dce1f2365f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.12.18 {"installer":{"name":"uv","version":"0.12.18","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / testcontainers_rustfs-1.1.0-py3-none-any.whl

Download URL testcontainers_rustfs-1.1.0-py3-none-any.whl
Size 5.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
5501941c60ce345494e2e75db544e43dd5b1b20bcbe5853868a146ed496f19f5
BLAKE2b-256 checksum
How to use checksums
4395ef459abd20ba44058faed86095a333a952255c763bbc433b013aff4ac3eb
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.12.18 {"installer":{"name":"uv","version":"0.12.18","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release history Release notifications | RSS feed

This release

1.1.0 This release

2 release files

1.0.0

2 release files

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