一个用于与Amazon SQS交互的简单库。
项目描述
qoo 是一个用Python编写的非常简单的Amazon SQS客户端。它旨在比boto3更容易使用,并且仅专注于Amazon SQS,忽略AWS生态系统的其余部分。
特性
与SQS队列交互更简单
自动支持AWS_ACCESS_KEY_ID、AWS_SECRET_ACCESS_KEY和AWS_DEFAULT_REGION环境变量。
自动有用的消息/作业元数据
用法
安装
pip install qoo
基本用法
import qoo
# list SQS queue names
qoo.list_queues()
# get an existing queue
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
job.delete()
测试
可以使用tox运行测试!
# run tests
tox
项目详情
关闭
qoo-0.0.4.tar.gz的散列值
算法 | 散列摘要 | |
---|---|---|
SHA256 | 699d304ab315c11bc6fce010d89232604d7b38e1c7a6c2235862e3b71c6b1853 |
|
MD5 | 413103943b792ac95f110656f79aa481 |
|
BLAKE2b-256 | c3027a06a16ab6ce7e5f1c5d524049b6fa229a6bffc925ebae50bb5563a50cfe |