Skip to main content

Boto SQS integration for Flask

Project description

Initialize

from flask_boto_sqs import FlaskBotoSQS

sqs = FlaskBotoSQS(app)

or:

sqs = FlaskBotoSQS()
sqs.init_app(app)

Configuration

Put kwargs for FlaskBotoSQS to ‘FLASK_BOTO_SQS’ in your Flask configuration.

app.config['FLASK_BOTO_SQS'] = {
    'region': 'ap-northeast-1',
    'aws_access_key_id': 'YOUR_AWS_ACCESS_KEY_ID',
    'aws_secret_access_key': 'YOUR_AWS_SECRET_ACCESS_KEY'
}

Usage

# http://docs.pythonboto.org/en/latest/ref/sqs.html
# http://docs.pythonboto.org/en/latest/sqs_tut.html

q = sqs.conn.get_queue('your-queue-name')

# write
from boto.sqs.message import Message
m = Message()
m.set_body('What a lovely day!')
q.write(m)

# read
m = q.read()
res = m.get_body()
print res
q.delete_message(m)

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for Flask-BotoSQS, version 0.1.1
Filename, size File type Python version Upload date Hashes
Filename, size Flask-BotoSQS-0.1.1.tar.gz (2.1 kB) File type Source Python version None Upload date Hashes View hashes

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN SignalFx SignalFx Supporter DigiCert DigiCert EV certificate StatusPage StatusPage Status page