A simple library for interacting with Amazon SQS.
Project description
qoo is a very simple Amazon SQS client, written in Python. It aims to be much more straight-forward to use than boto3, and specializes only in Amazon SQS, ignoring the rest of the AWS ecosystem.
Features
Easier interaction with SQS queues
Automatic support for AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY, and AWS_DEFAULT_REGION environment variables.
automatic useful message/job metadata
Usage
Installation
pip install qoo
Basic Usage
import qoo
# list bucket names
qoo.list()
# get an existing bucket
queue = qoo.get("$QUEUE_NAME")
# or create a queue
queue = qoo.create("$QUEUE_NAME")
# send a job, pass info/keys as kwargs
queue.send(info="foo", user_id="test_user") # etc.
# get an approximate count of messages in the queue
len(queue) # approximate total messages
queue.approx_not_visible # approximate number of message in the visibility timeout
# get a job
job = queue.receive(wait_time=1)
job.elapsed # time between sending the job and receiving it
job.md5_matches # boolean property to show that the md5 of the job matches what was sent
# and the data from the job is automatically converted into attrs
job.info # the string "foo"
job.user_id # the string "test_user"
# delete the job from the SQS queue
del job
job.delete()
Testing
Tests can be run with tox!
# run tests
tox
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
qoo-0.0.1.tar.gz
(5.6 kB
view details)
File details
Details for the file qoo-0.0.1.tar.gz
.
File metadata
- Download URL: qoo-0.0.1.tar.gz
- Upload date:
- Size: 5.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.32.2 CPython/3.7.1
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 25a6c339d126a39b120433c6b6cb4384ea1ca870226c1a52133276d0f232ec80 |
|
MD5 | 12ca739b658b2beebc098fbca101693d |
|
BLAKE2b-256 | f82be222c50391e3a6f19d1e3fd7ba66356b42ab0489d030388ba605d64ba6fe |