The localstack-client is a lightweight Python client designed to facilitate interaction with LocalStack, a cloud service emulator. It provides a thin wrapper around the popular boto3 library, automatically configuring endpoint URLs to point to your local LocalStack instance. The library is actively maintained with frequent releases; version 2.11 was released in January 2026.
pip install localstack-clientVerified import paths — ran on the pinned version, not inferred.
This quickstart demonstrates how to initialize a session with localstack-client and interact with a local S3 service. It creates a bucket, uploads a file, lists buckets, and downloads the file, all against a running LocalStack instance. Remember that a LocalStack instance must be running and accessible before executing this code.
Migrate your configuration to use `AWS_ENDPOINT_URL`. For example, set `os.environ['AWS_ENDPOINT_URL'] = 'http://localhost:4566'` before initializing the session.
Ensure you have LocalStack installed (e.g., via `pip install localstack` and `localstack start`) and that the Docker container is running and accessible (typically on `localhost:4566`).
Use appropriate hostnames like `host.docker.internal` (Docker Desktop), or configure your Docker network and `AWS_ENDPOINT_URL` environment variable to point to the correct IP address or service name for LocalStack. Consult LocalStack's networking documentation for specific scenarios.
Regularly update your LocalStack Docker image (e.g., `localstack update docker-images` or by pulling the `latest` or a specific version tag for `localstack/localstack-pro` Docker image). Consult LocalStack's release notes and feature coverage for service-specific compatibility.
Refer to the LocalStack upgrade guides for versions 3.0 and 4.0 to understand necessary environment and configuration adjustments. Always ensure your LocalStack CLI is up-to-date (`pip install --upgrade localstack`).
Ensure your LocalStack instance is running (e.g., `docker-compose up -d`), verify its exposed port (default 4566), and if your client code is running inside another Docker container, use `http://host.docker.internal:4566` (for Docker Desktop) or the LocalStack container's service name/IP as the `endpoint_url` in your boto3 client configuration.
Confirm LocalStack is running and listening on the expected port (usually 4566). Check `docker-compose ps` if using Docker Compose, or `netstat` on your host. If running in Docker, ensure proper port mapping and connectivity between containers or to the host.
Install the library using pip: `pip install localstack-client`. If you are using a virtual environment, make sure it is activated before installation.
When creating a boto3 client, ensure `endpoint_url` is explicitly set to your LocalStack instance (e.g., `http://localhost:4566`) to prevent calls to real AWS. Additionally, provide dummy AWS credentials (e.g., `aws_access_key_id='test'`, `aws_secret_access_key='test'`, `region_name='us-east-1'`) in your client creation or as environment variables for consistent LocalStack interaction.
No dependency data recorded yet.