https://github.com/jpetrucciani/qoo
A simple library for interacting with Amazon SQS.
https://github.com/jpetrucciani/qoo
amazon-sqs aws boto boto3 hacktoberfest python sqs
Last synced: 6 months ago
JSON representation
A simple library for interacting with Amazon SQS.
- Host: GitHub
- URL: https://github.com/jpetrucciani/qoo
- Owner: jpetrucciani
- License: mit
- Created: 2019-07-22T14:13:46.000Z (about 6 years ago)
- Default Branch: master
- Last Pushed: 2022-12-08T06:37:18.000Z (almost 3 years ago)
- Last Synced: 2024-10-18T23:21:31.026Z (12 months ago)
- Topics: amazon-sqs, aws, boto, boto3, hacktoberfest, python, sqs
- Language: Python
- Homepage:
- Size: 150 KB
- Stars: 3
- Watchers: 3
- Forks: 1
- Open Issues: 7
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
[](https://travis-ci.org/jpetrucciani/qoo)
[](https://badge.fury.io/py/qoo)
[](https://github.com/ambv/black)
[](https://www.python.org/downloads/release/python-350/)
[](https://github.com/jpetrucciani/archives)**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
```bash
pip install qoo
```## Basic Usage
```python
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()
```# Testing
Tests can be run with tox\!
```bash
# run tests
tox
```