Boto3 SQS Extended Client Library for Python
The Amazon SQS Extended Client Library for Python (version 0.5.1) is modelled after the original Amazon SQS Extended Client for Java. It stores large SQS payloads in Amazon S3 (over the 256 KB SQS limit) and puts a pointer on the queue.
You can:
- Use one
SQSClientExtendedas your SQS client — you do not need a separateboto3.client("sqs")for queue operations. - Store payloads in S3 only when they exceed 256 KB, or always (
always_through_s3). - Send and receive messages whose body is a Java-compatible
PayloadS3Pointer. - Delete the S3 object when the SQS message is deleted (optional).
- Change visibility and batch-send/delete using S3-embedded receipt handles.
Getting Started
- Sign up for AWS -- Before you begin, you need an AWS account. For more information about creating an AWS account and retrieving your AWS credentials, see AWS Account and Credentials.
- Sign up for Amazon SQS -- Go to the Amazon SQS console to sign up for the service.
- Minimum requirements -- Python 3.9+
- Further information - Read the API documentation.
Installation
Requires Python 3.9+.
PyPI project pysqs-extended-client is stuck at 0.0.1 until the account is recovered (issue #19). 0.0.1 does not include the extended client in this tree. Do not pip install pysqs-extended-client without a pin.
PyPI publishing of this release is coming once that account is recovered. Until then, install the tagged 0.5.0 release:
pip install git+https://github.com/timothymugayi/boto3-sqs-extended-client-lib@v0.5.0
The 0.5.1 fixes are on master until v0.5.1 is tagged. Install that branch, or pin the full commit SHA of the revision you deploy. A branch name moves.
pip install "pysqs-extended-client @ git+https://github.com/timothymugayi/boto3-sqs-extended-client-lib.git@master"
pip install "pysqs-extended-client @ git+https://github.com/timothymugayi/boto3-sqs-extended-client-lib.git@<commit-sha>"
Quick start
Send, receive, and delete through one SQSClientExtended. Messages under 256 KB stay in SQS unless you set always_through_s3=True on ExtendedClientConfiguration before constructing the client. receive_message returns a list of messages (an empty queue returns []). Call style, frozen config, and credentials are in Configuration.
from pysqs_extended_client import SQSClientExtended, ExtendedClientConfiguration
sqs = SQSClientExtended(
aws_access_key_id,
aws_secret_access_key,
aws_region_name,
"my-payload-bucket",
)
# Or always offload:
# sqs = SQSClientExtended(..., config=ExtendedClientConfiguration(
# s3_bucket_name="my-payload-bucket", always_through_s3=True,
# ))
sqs.send_message(queue_url, "small body")
# Overflow or always-through-S3 writes a Java-compatible pointer:
# ["software.amazon.payloadoffloading.PayloadS3Pointer", {"s3BucketName": "...", "s3Key": "..."}]
# and a reserved attribute SQSLargePayloadSize (or ExtendedPayloadSize if configured).
messages = sqs.receive_message(queue_url) # list, empty when the queue is empty
for message in messages:
sqs.change_message_visibility(queue_url, message["ReceiptHandle"], 60)
sqs.delete_message(queue_url, message["ReceiptHandle"])
Breaking changes
0.5.0 leaves a confirmed missing payload on the queue, raises ValueError at construction when delete_s3_before_sqs=True, and requires sqs:GetQueueAttributes plus a FIFO redrive policy. Notes for 0.4.0, 0.4.1, and 0.5.0 are in Migration.
Required before production
These are not optional, and this library does not do them. A green test run does not show that they are in place. The library is ready for a payment only when the code in this release is what you run and every condition below is true.
- S3 lifecycle. The payload prefix has an S3 lifecycle rule whose expiration is longer than the sum of the source-queue retention and the dead-letter retention. Longer than each retention on its own is not enough. A shorter rule deletes the object while the message can still be read. Details
- FIFO redrive. The FIFO queue has a redrive policy with a
deadLetterTargetArnand amaxReceiveCountof at least 1. The dead-letter queue must also be FIFO. Send, batch send, and receive on a.fifoqueue refuse to run when the policy is missing, empty, incomplete, or hasmaxReceiveCountof 0. The read needssqs:GetQueueAttributes, which is new in 0.5.0. Details - Idempotent handler. The handler is idempotent on the instruction id inside the payload, not the SQS message id. A
message_deduplication_idexpires after 5 minutes, and a move to the dead-letter queue is a new message id. Details - Only this library receives and deletes. This library is the only receiver and the only deleter on the queue. Java may send text. If the Java extended client receives or deletes, the payment can still disappear, and
message_leftdoes not fire. Details
A timeout during receive still counts as a receive. A message dead-lettered that way is recoverable until the dead-letter retention, as long as the lifecycle rule has not deleted the object. It is not the missing-object loss.
How a receive timeout differs from the missing-object loss.
Documentation
- Configuration — options, fail-fast startup checks, injected clients, worker threads, pass-through API
- IAM — producer and consumer policies, including
s3:ListBucketon the bucket ARN,s3:DeleteObject, andsqs:GetQueueAttributes - FIFO and redrive — deduplication ids,
RedrivePolicy/maxReceiveCount, FIFO dead-letter queue, S3 lifecycle, idempotent handlers - Events —
message_left,s3_object_orphaned, their causes, and what to alert on - Binary and files —
bytes, files, and streaming payloads - Java compatibility —
PayloadS3Pointer, legacy attribute, and not sharing receive or delete with the Java client - Migration — 0.4.0, 0.4.1, and 0.5.0 notes
- Testing — LocalStack and local unit tests
Feedback
We use GitHub issues for tracking bugs and feature requests.
- Give feedback here.
- If you'd like to contribute a new feature or bug fix, go ahead submit a pull request.
Metadata
Release files for pysqs-extended-client 0.5.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| pysqs_extended_client-0.5.1.tar.gz | 57.0 kB | With provenance | Details for pysqs_extended_client-0.5.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| pysqs_extended_client-0.5.1-py3-none-any.whl | Python 3 | none | any | Details for pysqs_extended_client-0.5.1-py3-none-any.whl |
Total release size: 85.1 kB
Release files / pysqs_extended_client-0.5.1.tar.gz
| Download URL | pysqs_extended_client-0.5.1.tar.gz |
|---|---|
| Size | 57.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
d31ce1dce6fbe0c0d1878eb4002c041027ff1312c2e03bfdb4597f1b3d5c6d19
|
|
BLAKE2b-256 checksum How to use checksums |
3fe76b1c8baebade352107ca5045bb37e5a5dada134ea4c19355d00348986bfc
|
| 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 8, 2026.
Transparency logRelease files / pysqs_extended_client-0.5.1-py3-none-any.whl
| Download URL | pysqs_extended_client-0.5.1-py3-none-any.whl |
|---|---|
| Size | 28.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
c6cf7701f91270243c7b2d9683bf5e501fa180c12cbb8574eba93d3e3607de7f
|
|
BLAKE2b-256 checksum How to use checksums |
4f07e7a870c63b515f2847816efc9e5ae94b0fcb6638e00e506e4c6c0a140cea
|
| 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 8, 2026.
Transparency logSecurity for pysqs-extended-client 0.5.1
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.
Attestation for pysqs_extended_client-0.5.1.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 8, 2026.
Transparency logA 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.