{"id":18636684,"url":"https://github.com/localstack/localstack-python-client","last_synced_at":"2025-05-16T00:08:45.652Z","repository":{"id":45049439,"uuid":"96112359","full_name":"localstack/localstack-python-client","owner":"localstack","description":"🐍  A lightweight Python client for LocalStack","archived":false,"fork":false,"pushed_at":"2023-10-19T20:27:38.000Z","size":88,"stargazers_count":171,"open_issues_count":4,"forks_count":33,"subscribers_count":19,"default_branch":"master","last_synced_at":"2024-04-25T22:20:24.378Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/localstack.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2017-07-03T13:12:32.000Z","updated_at":"2024-04-24T07:35:51.000Z","dependencies_parsed_at":"2024-01-23T21:25:55.067Z","dependency_job_id":null,"html_url":"https://github.com/localstack/localstack-python-client","commit_stats":{"total_commits":83,"total_committers":24,"mean_commits":"3.4583333333333335","dds":0.4337349397590361,"last_synced_commit":"14aadb3bad3fb987d50e96b049c97e0bdec75a2e"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/localstack%2Flocalstack-python-client","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/localstack%2Flocalstack-python-client/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/localstack%2Flocalstack-python-client/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/localstack%2Flocalstack-python-client/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/localstack","download_url":"https://codeload.github.com/localstack/localstack-python-client/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254442854,"owners_count":22071878,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-07T05:31:12.192Z","updated_at":"2025-05-16T00:08:40.623Z","avatar_url":"https://github.com/localstack.png","language":"Python","readme":"# LocalStack Python Client\n\n\u003cp align=\"center\"\u003e\n    \u003ca href=\"https://img.shields.io/pypi/v/localstack-client\"\u003e\u003cimg src=\"https://img.shields.io/pypi/v/localstack-client\" alt=\"PyPI version\" height=\"18\"\u003e\u003c/a\u003e\n    \u003cimg src=\"https://img.shields.io/badge/license-Apache License 2.0-brightgreen\" alt=\"license Apache 2.0\"/\u003e\n    \u003cimg src=\"https://github.com/localstack/localstack-python-client/actions/workflows/ci.yml/badge.svg\" alt=\"GitHub-Actions-Build\"/\u003e\n    \u003ca href=\"https://pepy.tech/project/localstack-client\"\u003e\u003cimg src=\"https://pepy.tech/badge/localstack-client\" alt=\"PyPi downloads\" height=\"18\"\u003e\u003c/a\u003e\n\u003c/p\u003e\n\nThis is an easy-to-use Python client for [LocalStack](https://github.com/localstack/localstack).\nThe client library provides a thin wrapper around [boto3](https://github.com/boto/boto3) which\nautomatically configures the target endpoints to use LocalStack for your local cloud\napplication development.\n\n## Prerequisites\n\nTo make use of this library, you need to have [LocalStack](https://github.com/localstack/localstack) installed on your local machine. In particular, the `localstack` command needs to be available.\n\n## Installation\n\nThe easiest way to install *LocalStack* is via `pip`:\n\n```\npip install localstack-client\n```\n\n## Usage\n\nThis library provides an API that is identical to `boto3`'s. A minimal way to try it out is to replace `import boto3` with `import localstack_client.session as boto3`. This will allow your boto3 calls to work as normal.\n\nFor example, to list all s3 buckets in localstack:\n\n```python\nimport localstack_client.session as boto3\nclient = boto3.client('s3')\nresponse = client.list_buckets()\n```\n\nAnother example below shows using `localstack_client` directly. To list the SQS queues\nin your local (LocalStack) environment, use the following code:\n\n```python\nimport localstack_client.session\n\nsession = localstack_client.session.Session()\nsqs = session.client('sqs')\nassert sqs.list_queues() is not None\n```\n\nIf you use `boto3.client` directly in your code, you can mock it.\n\n```python\nimport localstack_client.session\nimport pytest\n\n\n@pytest.fixture(autouse=True)\ndef boto3_localstack_patch(monkeypatch):\n    session_ls = localstack_client.session.Session()\n    monkeypatch.setattr(boto3, \"client\", session_ls.client)\n    monkeypatch.setattr(boto3, \"resource\", session_ls.resource)\n```\n\n```python\nsqs = boto3.client('sqs')\nassert sqs.list_queues() is not None  # list SQS in localstack\n```\n\n## Configuration\n\nYou can use the following environment variables for configuration:\n\n* `AWS_ENDPOINT_URL`: The endpoint URL to connect to (takes precedence over `USE_SSL`/`LOCALSTACK_HOST` below)\n* `LOCALSTACK_HOST` (deprecated): A `\u003chostname\u003e:\u003cport\u003e` variable defining where to find LocalStack (default: `localhost:4566`).\n* `USE_SSL` (deprecated): Whether to use SSL when connecting to LocalStack (default: `False`).\n\n### Enabling Transparent Local Endpoints\n\nThe library contains a small `enable_local_endpoints()` util function that can be used to transparently run all `boto3` requests against the local endpoints.\n\nThe following sample illustrates how it can be used - after calling `enable_local_endpoints()`, the S3 `ListBuckets` call will be run against LocalStack, even though we're using the default boto3 module.\n```\nimport boto3\nfrom localstack_client.patch import enable_local_endpoints()\nenable_local_endpoints()\n# the call below will automatically target the LocalStack endpoints\nbuckets = boto3.client(\"s3\").list_buckets()\n```\n\nThe patch can also be unapplied by calling `disable_local_endpoints()`:\n```\nfrom localstack_client.patch import disable_local_endpoints()\ndisable_local_endpoints()\n# the call below will target the real AWS cloud again\nbuckets = boto3.client(\"s3\").list_buckets()\n```\n\n## Contributing\n\nIf you are interested in contributing to LocalStack Python Client, start by reading our [`CONTRIBUTING.md`](CONTRIBUTING.md) guide. You can further navigate our codebase and [open issues](https://github.com/localstack/localstack-python-client/issues). We are thankful for all the contributions and feedback we receive.\n\n## Changelog\n\nPlease refer to [`CHANGELOG.md`](CHANGELOG.md) to see the complete list of changes for each release.\n\n## License\n\nThe LocalStack Python Client is released under the Apache License, Version 2.0 (see `LICENSE`).\n","funding_links":[],"categories":["Client libraries"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flocalstack%2Flocalstack-python-client","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flocalstack%2Flocalstack-python-client","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flocalstack%2Flocalstack-python-client/lists"}