Storage Queue Input-Output Manager for Azure Storage Queue
Project description
AZ Queue Manager
AZ Queue Manager is a tool to manage messages in Azure Storage Queue.
It is a command line tool that can be used to send and receive messages from a queue. It can also be used to create and delete queues.
Getting Started
Install AZQueueManager and Extensions
# Install the base package
pip install azqueuemanager
# Install the csv-input extension
pip install azqeueuemanager-csv # or some other extension
Setup your script
# data.csv
name,age
John, 30
Jane, 25
from azqueuemanager import QueueManager, StorageQueue
from azqueuemanager.extensions.csv import csv_in, csv_out
CONNECTION_STRING="MY_CONNECTION_STRING"
queue_name="MYQUEUE"
queue = StorageQueue(
connection_string,
queue_name,
)
queue_manager = QueueManager(
queue=queue
input_transformer=csv_in,
output_transformer=csv_out,
)
Loading Data (Bulk)
While some extensions can manipulate individual records, the csv extension is designed to work with batches of messages. This means that the 'bulk_input_transformer' will receive a file and create a new message for each record.
queue_manager.load_messages('data.csv')
# >>> 2 messages loaded into MYQUEUE
queue_manager.peek_messages() # This will show the messages in the queue without popping them.
# >>> [
# {id: 1234567890, content:{"'name': 'John', 'age': 30"}},
# {id: 1234567890, content:{"'name': 'Jane', 'age': 25"}}
# ]
Retrieving Data (Bulk)
This will retrieve all messages from the queue. It will also delete the messages from the queue. To keep the messages in the queue set the delete_after
attribute to False
.
QueueManager.recieve_messages() # This will get the messages from the queue
# >>> 2 messages received from MYQUEUE
# {
# ids: [1234567890, 1234567890],
# content:{"""name, age
# 'John', 30
# 'Jane', 25"""}
What is a Message Transformer?
THe message Transformer is a tool that can be used to transform messages entering/exiting a queue. It can be used to work with rich json messages.
Quick Access to Storage Queue Methods
There are a few methods that are used frequently when working with queues. These methods are available as quick access commands.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for azqueuemanager-0.0.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | de74e48b47bc61adfe477bad9143ae8ad59f4b410e077013dc97935376dd6f86 |
|
MD5 | 5b3e66b263d6bfc47590c5f251b348b1 |
|
BLAKE2b-256 | 8ea663b4b3818f1a35ee6e4006a42af0272eb85fb37e21686b37f569d0ad2fe4 |