<commit_before>#############################################
 kombu - AMQP Messaging Framework for Python
#############################################

:Version: 1.2.0

Synopsis
========

`Kombu` is an `AMQP`_ messaging framework for Python.

AMQP is the Advanced Message Queuing Protocol, an open standard protocol
for message orientation, queuing, routing, reliability and security.

One of the most popular implementations of AMQP is `RabbitMQ`_.

The aim of `Kombu` is to make messaging in Python as easy as possible by
providing an idiomatic high-level interface for the AMQP protocol, and also
provide proven and tested solutions to common messaging problems.

Features
========

* Allows application authors to support several message server
  solutions by using pluggable transports.

    * AMQP transports for both the `amqplib`_ (sync) and
      `pika`_ (sync + async) clients.

    * Virtual transports makes it really easy to add support for non-AMQP
      transports.  There is already built-in support for `Redis`_,
      `Beanstalk`_, `Amazon SQS`_, `CouchDB`_, and `MongoDB`_.

    * SQLAlchemy and Django ORM transports exists as plug-ins (
      `kombu-sqlalchemy`_ and `django-kombu`_).

    * In-memory transport for unit testing.

* Supports automatic encoding, serialization and compression of message
  payloads.

* Consistent exception handling across transports.

* The ability to ensure that an operation is performed by gracefully
  handling connection and channel errrors.

* Several annoyances with `amqplib`_ has been fixed, like supporting
  timeouts and the ability to wait for events on more than one channel.

* Projects already using `carrot`_ can easily be ported by using
  a compatibility layer.


For an introduction to AMQP you should read the article `Rabbits and warrens`_,
and the `Wikipedia article about AMQP`_.



.. _`RabbitMQ`: http://www.rabbitmq.com/
.. _`AMQP`: http://amqp.org
.. _`Redis`: http://code.google.com/p/redis/
.. _`Amazon SQS`: http://aws.amazon.com/sqs/
.. _`MongoDB`: http://www.mongodb.org/
.. _`CouchDB`: http://couchdb.apache.org/
.. _`Beanstalk`: http://kr.github.com/beanstalkd/
.. _`Rabbits and warrens`: http://blogs.digitar.com/jjww/2009/01/rabbits-and-warrens/
.. _`amqplib`: http://barryp.org/software/py-amqplib/
.. _`pika`: http://github.com/tonyg/pika
.. _`Wikipedia article about AMQP`: http://en.wikipedia.org/wiki/AMQP
.. _`kombu-sqlalchemy`: http://github.com/ask/kombu-sqlalchemy/
.. _`django-kombu`: http://github.com/ask/django-kombu/
.. _`carrot`: http://pypi.python.org/pypi/carrot/


Transport Comparison
====================

+---------------+----------+------------+-----------+---------------+
| **Client**    | **Type** | **Direct** | **Topic** | **Fanout**    |
+---------------+----------+------------+-----------+---------------+
| *amqplib*     | Native   | Yes        | Yes       | Yes           |
+---------------+----------+------------+-----------+---------------+
| *pika*        | Native   | Yes        | Yes       | Yes           |
+---------------+----------+------------+-----------+---------------+
| *redis*       | Virtual  | Yes        | Yes[*]_   | Yes (PUB/SUB) |
+---------------+----------+------------+-----------+---------------+
| *beanstalk*   | Virtual  | Yes        | Yes[*]_   | No            |
+---------------+----------+------------+-----------+---------------+
| *SQS*         | Virtual  | Yes        | Yes[*]_   | Yes[#]_       |
+---------------+----------+------------+-----------+---------------+
| *mongodb*     | Virtual  | Yes        | Yes[*]_   | No            |
+---------------+----------+------------+-----------+---------------+
| *couchdb*     | Virtual  | Yes        | Yes[*]_   | No            |
+---------------+----------+------------+-----------+---------------+
| *in-memory*   | Virtual  | Yes        | Yes[*]_   | No            |
+---------------+----------+------------+-----------+---------------+


.. [*] Declarations only kept in memory, so exchanges/queues
       must be declared by all clients that needs them.

.. [#] Fanout supported via storing routing tables in SimpleDB.
       Can be disabled by setting the ``supports_fanout`` transport option.


Documentation
-------------

Kombu is using Sphinx, and the latest documentation is available at GitHub:

    http://ask.github.com/kombu

Quick overview
--------------

::

    from kombu.connection import BrokerConnection
    from kombu.messaging import Exchange, Queue, Consumer, Producer

    media_exchange = Exchange("media", "direct", durable=True)
    video_queue = Queue("video", exchange=media_exchange, key="video")

    # connections/channels
    connection = BrokerConnection("localhost", "guest", "guest", "/")
    channel = connection.channel()

    # produce
    producer = Producer(channel, exchange=media_exchange, serializer="json")
    producer.publish({"name": "/tmp/lolcat1.avi", "size": 1301013})

    # consume
    consumer = Consumer(channel, video_queue)
    consumer.register_callback(process_media)
    consumer.consume()

    # Process messages on all channels
    while True:
        connection.drain_events()

    # Consume from several queues on the same channel:
    video_queue = Queue("video", exchange=media_exchange, key="video")<commit_msg>fixing docs re: key vs routing_key<commit_after>#############################################
 kombu - AMQP Messaging Framework for Python
#############################################

:Version: 1.2.0

Synopsis
========

`Kombu` is an `AMQP`_ messaging framework for Python.

AMQP is the Advanced Message Queuing Protocol, an open standard protocol
for message orientation, queuing, routing, reliability and security.

One of the most popular implementations of AMQP is `RabbitMQ`_.

The aim of `Kombu` is to make messaging in Python as easy as possible by
providing an idiomatic high-level interface for the AMQP protocol, and also
provide proven and tested solutions to common messaging problems.

Features
========

* Allows application authors to support several message server
  solutions by using pluggable transports.

    * AMQP transports for both the `amqplib`_ (sync) and
      `pika`_ (sync + async) clients.

    * Virtual transports makes it really easy to add support for non-AMQP
      transports.  There is already built-in support for `Redis`_,
      `Beanstalk`_, `Amazon SQS`_, `CouchDB`_, and `MongoDB`_.

    * SQLAlchemy and Django ORM transports exists as plug-ins (
      `kombu-sqlalchemy`_ and `django-kombu`_).

    * In-memory transport for unit testing.

* Supports automatic encoding, serialization and compression of message
  payloads.

* Consistent exception handling across transports.

* The ability to ensure that an operation is performed by gracefully
  handling connection and channel errrors.

* Several annoyances with `amqplib`_ has been fixed, like supporting
  timeouts and the ability to wait for events on more than one channel.

* Projects already using `carrot`_ can easily be ported by using
  a compatibility layer.


For an introduction to AMQP you should read the article `Rabbits and warrens`_,
and the `Wikipedia article about AMQP`_.



.. _`RabbitMQ`: http://www.rabbitmq.com/
.. _`AMQP`: http://amqp.org
.. _`Redis`: http://code.google.com/p/redis/
.. _`Amazon SQS`: http://aws.amazon.com/sqs/
.. _`MongoDB`: http://www.mongodb.org/
.. _`CouchDB`: http://couchdb.apache.org/
.. _`Beanstalk`: http://kr.github.com/beanstalkd/
.. _`Rabbits and warrens`: http://blogs.digitar.com/jjww/2009/01/rabbits-and-warrens/
.. _`amqplib`: http://barryp.org/software/py-amqplib/
.. _`pika`: http://github.com/tonyg/pika
.. _`Wikipedia article about AMQP`: http://en.wikipedia.org/wiki/AMQP
.. _`kombu-sqlalchemy`: http://github.com/ask/kombu-sqlalchemy/
.. _`django-kombu`: http://github.com/ask/django-kombu/
.. _`carrot`: http://pypi.python.org/pypi/carrot/


Transport Comparison
====================

+---------------+----------+------------+-----------+---------------+
| **Client**    | **Type** | **Direct** | **Topic** | **Fanout**    |
+---------------+----------+------------+-----------+---------------+
| *amqplib*     | Native   | Yes        | Yes       | Yes           |
+---------------+----------+------------+-----------+---------------+
| *pika*        | Native   | Yes        | Yes       | Yes           |
+---------------+----------+------------+-----------+---------------+
| *redis*       | Virtual  | Yes        | Yes[*]_   | Yes (PUB/SUB) |
+---------------+----------+------------+-----------+---------------+
| *beanstalk*   | Virtual  | Yes        | Yes[*]_   | No            |
+---------------+----------+------------+-----------+---------------+
| *SQS*         | Virtual  | Yes        | Yes[*]_   | Yes[#]_       |
+---------------+----------+------------+-----------+---------------+
| *mongodb*     | Virtual  | Yes        | Yes[*]_   | No            |
+---------------+----------+------------+-----------+---------------+
| *couchdb*     | Virtual  | Yes        | Yes[*]_   | No            |
+---------------+----------+------------+-----------+---------------+
| *in-memory*   | Virtual  | Yes        | Yes[*]_   | No            |
+---------------+----------+------------+-----------+---------------+


.. [*] Declarations only kept in memory, so exchanges/queues
       must be declared by all clients that needs them.

.. [#] Fanout supported via storing routing tables in SimpleDB.
       Can be disabled by setting the ``supports_fanout`` transport option.


Documentation
-------------

Kombu is using Sphinx, and the latest documentation is available at GitHub:

    http://ask.github.com/kombu

Quick overview
--------------

::

    from kombu.connection import BrokerConnection
    from kombu.messaging import Exchange, Queue, Consumer, Producer

    media_exchange = Exchange("media", "direct", durable=True)
    video_queue = Queue("video", exchange=media_exchange, routing_key="video")

    # connections/channels
    connection = BrokerConnection("localhost", "guest", "guest", "/")
    channel = connection.channel()

    # produce
    producer = Producer(channel, exchange=media_exchange, serializer="json")
    producer.publish({"name": "/tmp/lolcat1.avi", "size": 1301013})

    # consume
    consumer = Consumer(channel, video_queue)
    consumer.register_callback(process_media)
    consumer.consume()

    # Process messages on all channels
    while True:
        connection.drain_events()

    # Consume from several queues on the same channel:
    video_queue = Queue("video", exchange=media_exchange, key="video")
{'fraction_non_alphanumeric': 0.25605960577195136, 'fraction_numerical': 0.003206639630293313, 'mean_word_length': 2.007373794668179, 'pattern_counts': {'":': 4, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 4, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 4, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7334226', 'n_tokens_mistral': 3131, 'n_tokens_neox': 2835, 'n_words': 854}