Metadata-Version: 1.1
Name: phase.messager
Version: 0.3.6
Summary: Python module to exchange message over RabbitMQ
Home-page: https://github.com/liogen/phase.messager
Author: Pierre Leray
Author-email: pierreleray64@gmail.com
License: MIT
Description: ==============
        phase.messager
        ==============
        
        .. image:: http://img.shields.io/travis/liogen/phase.messager.png?branch=master
            :target: https://travis-ci.org/liogen/phase.messager
            :alt: Travis CI Build Status
        
        .. image:: http://img.shields.io/pypi/v/phase.messager.png
            :target: https://pypi.python.org/pypi/phase.messager
            :alt: Latest Version
        
        .. image:: http://img.shields.io/pypi/dm/phase.messager.png
            :target: https://pypi.python.org/pypi/phase.messager
            :alt: Downloads
        
        .. image:: http://img.shields.io/badge/license-MIT-red.png
            :target: https://github.com/liogen/phase.messager
            :alt: License
        
        Python module to exchange message over RabbitMQ.
        
        This class let us send and receive easily message over RabbitMQ using `Pika <http://pika.readthedocs.org/en/latest/>`_ module.
        
        For more information, full documentation is available on `readthedocs.org <http://phasemessager.readthedocs.org/en/latest/>`_
        
        Installation
        ------------
        
        Requirements:
        
          * Platform: Unix (only tested on Ubuntu 12.04)
          * Python 2.7
          * Pip (last version)
          * RabbitMQ (last version)
        
        To install this software, you need to install python 2.7 and pip
        
        .. code-block:: bash
          
          $ sudo apt-get install python python-pip
          $ sudo pip install --upgrade pip
        
        Then, you have to install and configure RabbitMQ (change "admin" and "password" by your credential)
        
        .. code-block:: bash
          
          $ USERNAME="admin"
          $ PASSWORD="password" 
          $ echo "deb http://www.rabbitmq.com/debian/ testing main" > sudo /etc/apt/sources.list.d/rabbitmq.list
          $ wget http://www.rabbitmq.com/rabbitmq-signing-key-public.asc
          $ sudo apt-key add rabbitmq-signing-key-public.asc
          $ sudo apt-get update
          $ sudo apt-get install rabbitmq-server -y
          $ sudo service rabbitmq-server start
          $ sudo rabbitmq-plugins enable rabbitmq_management
          # If you get a 'command not found' error for this line, use: 
          # sudo /usr/lib/rabbitmq/bin/rabbitmq-plugins enable rabbitmq_management
          # sudo /usr/lib/rabbitmq/bin/rabbitmq-activate-plugins enable rabbitmq_management
          $ sudo rabbitmqctl add_user $USERNAME $PASSWORD
          $ sudo rabbitmqctl set_permissions -p / $USERNAME ".*" ".*" ".*"
          $ sudo rabbitmqctl delete_user guest
          $ sudo service rabbitmq-server restart
        
        Finally, you can install phase.messager
        
        .. code-block:: bash
          
          $ sudo pip install phase.messager
        
        To verify version of phase.messager installed package
        
        .. code-block:: bash
          
          $ pip show phase.messager
        
        Usage
        -----
        
        To send a message over RabbitMQ (examples/producer.py)
        
        .. code-block:: python
            
            import logging
            from messager.rbmq_messager import RabbitMQMessager
        
            VALID_USERNAME = "admin"
            VALID_PASSWORD = "password"
            VALID_HOST = "localhost"
        
            TOPIC = "TEST_RABBIT_MQ_MESSAGER"
            MESSAGE = "It works!"
        
            messager = RabbitMQMessager(VALID_USERNAME, VALID_PASSWORD, VALID_HOST)
            messager.send(TOPIC, MESSAGE)
        
        To Receive this message over RabbitMQ (examples/consumer.py)
        
        .. code-block:: python
        
            from messager.rbmq_messager import RabbitMQMessager
        
            VALID_USERNAME = "admin"
            VALID_PASSWORD = "password"
            VALID_HOST = "localhost"
        
            TOPIC = "TEST_RABBIT_MQ_MESSAGER"
        
            def callback(channel, method, properties, body):
                """
                    Callback called when a new message is available.
                """
                print(method.routing_key)
                print(body)
        
                # To avoid process blocking use this (need to be remove in production)
                channel.close()
        
            messager = RabbitMQMessager(VALID_USERNAME, VALID_PASSWORD, VALID_HOST)
            messager.consume([TOPIC], callback)
        
        Contribute
        ----------
        
        I am more than happy to accept external contributions like feedback, bug reports and pull requests. 
        
        Do not hesitate to post an `issue <https://github.com/liogen/phase.messager/issues>`_ if you have any problem to install or to use this software.
        
        You can also use this way to ask for features request. I am also available to answer you on `Stack Overflow <http://stackoverflow.com/questions/tagged/phase.messager>`_
        
        Here is the development process to test and validate your features.
        
        1. Prepare your development environment:
        
            .. code-block:: bash
        
                $ sudo apt-get install vim git-core
                # Install virtualenv and virtualenvwrapper if it's not done.
                $ sudo pip install virtualenvwrapper
                $ mkdir ~/.virtualenvs
                $ vim ~/.bashrc
                # Modify your ~/.bashrc and add this 2 lines:
                # export WORKON_HOME=~/.virtualenvs
                # source /usr/local/bin/virtualenvwrapper.sh
                $ bash
        
        2. Go on `github <https://github.com/liogen/phase.messager>`_ and fork this project.
        
        3. Clone it on your conputer:
        
            .. code-block:: bash
        
                $ cd <your_workspace>
                $ git clone git@github.com:<username>/phase.messager.git
                $ git checkout develop
        
        4. Prepare your virtualenv
        
            .. code-block:: bash
        
                $ mkvirtualenv phase
                (phase)$ pip install paver
                (phase)$ paver prepare
        
        5. Add functional or unit tests
        
        6. Code your features
        
        7. To validate your implementation, launch:
        
            .. code-block:: bash
        
                (phase)$ paver validate
        
        8. Modify Todo, Changelog and update documentation
        
        9. Commit and push on github:
        
            .. code-block:: bash
        
                (phase)$ git add .
                (phase)$ git commit -a -m "<your commit message>"
                (phase)$ git push origin develop  
        
        10. Propose a pull request on github
        
        License
        -------
        
        The MIT License (MIT)
        
        Copyright (c) 2014 Pierre Leray
        
        Permission is hereby granted, free of charge, to any person obtaining a copy
        of this software and associated documentation files (the "Software"), to deal
        in the Software without restriction, including without limitation the rights
        to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
        copies of the Software, and to permit persons to whom the Software is
        furnished to do so, subject to the following conditions:
        
        The above copyright notice and this permission notice shall be included in all
        copies or substantial portions of the Software.
        
        THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
        IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
        FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
        AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
        LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
        OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
        SOFTWARE.
Platform: UNKNOWN
Classifier: Development Status :: 5 - Production/Stable
Classifier: Environment :: Console
Classifier: Intended Audience :: Developers
Classifier: Intended Audience :: Education
Classifier: Intended Audience :: Information Technology
Classifier: Intended Audience :: Science/Research
Classifier: Operating System :: Unix
Classifier: Programming Language :: Python :: 2.7
Classifier: Topic :: Home Automation
Classifier: License :: OSI Approved :: MIT License
