Simple async SQS client
Project description
simple-async-sqs
simple-async-sqs is a opinionated minimalistic async Python client to interact with SQS.
simple-async-sqs is for developers who are tired of repeated configurations in task frameworks and prefer a simple message processing library.
Installation
uv add simple-async-sqs
Optionally add the type stubs for used in development:
uv add --dev simple-async-sqs[stubs]
Usage
A consumer can be simply created by Client.consume which is simply an AsyncIterator.
Messages must be either ack'd or nack'd after processing.
import asyncio
from simple_sqs.queue_client import QueueClient
async def process(client: QueueClient):
async for message in client.consume():
try:
print(message.get("Body"))
...
except Exception:
await client.nack(message, retry_timeout=20)
else:
await client.ack(message)
async def process_single():
async with QueueClient.create("my-queue") as client:
await process(client)
We can also easily parallelise the work here using asyncio.TaskGroup:
async def process_parallel(workers: int):
async with QueueClient.create("my-queue") as client:
async with asyncio.TaskGroup() as tg:
for _ in range(workers):
tg.create_task(process(client))
Producer
We can simply produce a message by:
await client.producer("my_message_payload", delay=10)
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file simple_async_sqs-0.1.0.tar.gz.
File metadata
- Download URL: simple_async_sqs-0.1.0.tar.gz
- Upload date:
- Size: 2.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
86a3c4cb99420ea9e60cdaecbdc2e2ce16e4b7bd2f536e27380a1a7e833b6a6f
|
|
| MD5 |
6594ca625ee7dd60036a8c94a1109ead
|
|
| BLAKE2b-256 |
2ca655d8c6511f37c1913c976376f14d53cd81a09c7fbdfe89a3b680bf629d27
|
Provenance
The following attestation bundles were made for simple_async_sqs-0.1.0.tar.gz:
Publisher:
python-publish.yml on Jamie-Chang/simple-async-sqs
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
simple_async_sqs-0.1.0.tar.gz -
Subject digest:
86a3c4cb99420ea9e60cdaecbdc2e2ce16e4b7bd2f536e27380a1a7e833b6a6f - Sigstore transparency entry: 716006757
- Sigstore integration time:
-
Permalink:
Jamie-Chang/simple-async-sqs@54bc7a1a8e3bbda6e27fc59268f8bd594cf67ef0 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/Jamie-Chang
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-publish.yml@54bc7a1a8e3bbda6e27fc59268f8bd594cf67ef0 -
Trigger Event:
release
-
Statement type:
File details
Details for the file simple_async_sqs-0.1.0-py3-none-any.whl.
File metadata
- Download URL: simple_async_sqs-0.1.0-py3-none-any.whl
- Upload date:
- Size: 3.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
eaefe700ea26ba4813cccf20b5fd59e56d8039b59c4e7acccc4ddbb7f968de70
|
|
| MD5 |
a8a0dd2df4790d1ffcda83aaf2ac9140
|
|
| BLAKE2b-256 |
01c474a150304b7199ddabb9fdb2e05d5fe5e06936b306d4fca4472070c19ec9
|
Provenance
The following attestation bundles were made for simple_async_sqs-0.1.0-py3-none-any.whl:
Publisher:
python-publish.yml on Jamie-Chang/simple-async-sqs
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
simple_async_sqs-0.1.0-py3-none-any.whl -
Subject digest:
eaefe700ea26ba4813cccf20b5fd59e56d8039b59c4e7acccc4ddbb7f968de70 - Sigstore transparency entry: 716006760
- Sigstore integration time:
-
Permalink:
Jamie-Chang/simple-async-sqs@54bc7a1a8e3bbda6e27fc59268f8bd594cf67ef0 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/Jamie-Chang
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-publish.yml@54bc7a1a8e3bbda6e27fc59268f8bd594cf67ef0 -
Trigger Event:
release
-
Statement type: