Metadata-Version: 2.0
Name: mamba-paw
Version: 0.3.1
Summary: Uses Azure storage queue/table for a simple worker
Home-page: https://github.com/ayudasystems/mamba-paw
Author: Maxime Lapointe
Author-email: maxime@ayudasystems.com
License: Apache 2.0
Description-Content-Type: UNKNOWN
Platform: UNKNOWN
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: Topic :: Software Development
Classifier: Programming Language :: Python :: 3.5
Classifier: Programming Language :: Python :: 3.6
Requires-Python: >=3.5
Requires-Dist: azure-storage (>==0.36.0)

===============================
mamba-paw (Python Azure Worker)
===============================

Base project for the **paw** package. Very much a work in progress.


To create tasks:


.. code:: python

    # tasks.py

    from paw import task

    @task(description='Stupid simple example')
    def task_one(print_me):
        print(print_me)
        return True


To start a worker:


.. code:: python

    # start_workers.py

    from paw import MainPawWorker
    import tasks  # importing tasks from tasks.py in local project

    workers = MainPawWorker(
        azure_storage_name='storage account name',
        azure_storage_private_key='storage account private key',
        azure_queue_name='name of the queue',
        azure_table_name='name of the table',
        tasks_module=tasks,
        workers=4
    )

    if __name__ == '__main__':
        workers.start_workers()


To queue a task:


.. code:: python

    # queue_tasks.py

    from paw import queue_task

    queue_task(
        task_name='task_one',
        account_name='storage account name',
        account_key='storage account private key',
        queue_name='name of the queue',
        args=['List', 'of', 'arguments'],
        kwargs={'Key_word': 'arguments'}
    )


