Skip to main content

Digital Fortress logo


Python SQS client

Getting Started

Install package

pip install sqs-client

Example

Subscribe

from sqs_client.client import SQSClient

sqs_client = SQSClient()


# Subscribe to a SQS
@sqs_client.task(
    queue_name="sqs-queue-name",
    wait_time_seconds=20,
    visibility_timeout=300,
    daemon=False,
)
def test_task(message):
    print("test_task received:", message)

Publish

from sqs_client.client import SQSClient
from sqs_client.publisher import Publisher

sqs_client = SQSClient()

sqs_client.publish(
    queue_name="sqs-queue-name",
    message="test message",
)

# or

publisher = Publisher(
    sqs_client=sqs_client,
    queue_name="sqs-queue-name",
)

publisher.publish("test message")

Lazy mode

Faster to subscribe and publish a message to SQS

from sqs_client.client import SQSClient

sqs_client = SQSClient()


# Subscribe to a SQS
@sqs_client.task(
    queue_name="sqs-queue-name",
    lazy=True,
    daemon=False,
    wait_time_seconds=20,
    visibility_timeout=300,
)
def test_task(message, abc):
    print("test_task received message:", message)
    print("test_task received abc:", abc)


# Publish a message
test_task.trigger("Test message", abc=1)

Publish a lazy mode message without subscribe

from sqs_client.client import SQSClient
from sqs_client.publisher import Publisher

sqs_client = SQSClient()

publisher = Publisher(
    sqs_client=sqs_client,
    queue_name="sqs-queue-name",
)

publisher.publish_lazy("Test lazy message", abc=1)

License

This project is Copyright (c) 2023 and onwards Digital Fortress. It is free software and may be redistributed under the terms specified in the LICENSE file.

About

Digital Fortress logo

This project is made and maintained by Digital Fortress.

We are an experienced team in R&D, software, hardware, cross-platform mobile and DevOps.

See more of our projects or do you need to complete one?

-> Let’s connect with us

Metadata

Release files for sqs-client 0.1.7

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for sqs-client 0.1.7
File Size Uploaded
sqs_client-0.1.7.tar.gz 6.6 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for sqs-client 0.1.7
File Interpreter ABI Platform
sqs_client-0.1.7-py3-none-any.whl Python 3 none any Details

Total release size: 14.0 kB

Release files / sqs_client-0.1.7.tar.gz

Download URL sqs_client-0.1.7.tar.gz
Size 6.6 kB
Tags Source
SHA-256 checksum
How to use checksums
c6017c4ea837b3f0f739289a2f1df69b7c98355ec73e30471086ddf4d7a3d728
BLAKE2b-256 checksum
How to use checksums
5485a3c6fed902eab13027c0ab1f5e38bda45055c26e516eb4e33078521eabf1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.0 CPython/3.8.18

Release files / sqs_client-0.1.7-py3-none-any.whl

Download URL sqs_client-0.1.7-py3-none-any.whl
Size 7.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
a3cb1670131591c973db900de544370afe13342bfec3c38065dd62308bc974dd
BLAKE2b-256 checksum
How to use checksums
54afdccc3c565710cc087311eff0927a2ba9781da6f95b8aa7b1fdc56dee43a8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.0 CPython/3.8.18

Release history Release notifications | RSS feed

This release

0.1.7 This release

2 release files

0.1.6

2 release files

0.1.5

2 release files

0.1.4

2 release files

0.1.3

2 release files

0.1.2

2 release files

0.1.1

2 release files

0.1.0

2 release files

0.0.4

2 release files

0.0.3

2 release files

0.0.2

2 release files

0.0.1

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