<commit_before>sprockets.mixins.avro_publisher
===============================
AMQP Publishing Mixin for publishing messages as Avro datum

|Version| |Downloads| |Travis| |CodeCov| |ReadTheDocs|

Installation
------------
``sprockets.mixins.avro_publisher`` is available on the
`Python Package Index <https://pypi.python.org/pypi/sprockets.mixins.avro_publisher>`_
and can be installed via ``pip`` or ``easy_install``:

.. code-block:: bash

   pip install sprockets.mixins.avro_publisher

Requirements
------------
- sprockets.mixins.amqp>=0.1.1

Example
-------
This examples demonstrates the most basic usage of ``sprockets.mixins.avro_publisher``

.. code:: bash

   export AMQP_URL="amqp://user:password@rabbitmq_host:5672/%2f"
   python my-example-app.py


.. code:: python

   import json

   from tornado import gen
   from tornado import web
   from sprockets.mixins import avro_publisher

   class RequestHandler(avro_publisher.AvroPublishingMixin, web.RequestHandler):

       @gen.coroutine
       def get(self, *args, **kwargs):
           body = {'request': self.request.path, 'args': args, 'kwargs': kwargs}
           yield self.amqp_publish('exchange', 'routing.key', json.dumps(body),
                                   {'content_type': avro_publisher.DATUM_MIME_TYPE,
                                    'type': 'avro-schema-name'


                                    })

   settings = {'avro_schema_uri_format': 'http://my-schema-repository/%(name)s.avsc'}
   application = web.Application([(r"/", RequestHandler),],
                                 debug=True,
                                 **settings)


   if __name__ == "__main__":
       application.listen(8888)
       logging.basicConfig(level=logging.INFO)
       ioloop.IOLoop.current().start()


Source
------
``sprockets.mixins.avro_publisher`` source is available on Github at `https://github.com/sprockets/sprockets.mixins.avro_publisher <https://github.com/sprockets/sprockets.mixins.avro_publisher>`_

License
-------
``sprockets.mixins.avro_publisher`` is released under the `3-Clause BSD license <https://github.com/sprockets/sprockets.mixins.avro_publisher/blob/master/LICENSE>`_.

.. |Version| image:: https://badge.fury.io/py/sprockets.mixins.avro_publisher.svg?
   :target: http://badge.fury.io/py/sprockets.mixins.avro_publisher

.. |Travis| image:: https://travis-ci.org/sprockets/sprockets.mixins.avro_publisher.svg?branch=master
   :target: https://travis-ci.org/sprockets/sprockets.mixins.avro_publisher

.. |CodeCov| image:: http://codecov.io/github/sprockets/sprockets.mixins.avro_publisher/coverage.svg?branch=master
   :target: https://codecov.io/github/sprockets/sprockets.mixins.avro_publisher?branch=master

.. |Downloads| image:: https://pypip.in/d/sprockets.mixins.avro_publisher/badge.svg?
   :target: https://pypi.python.org/pypi/sprockets.mixins.avro_publisher

.. |ReadTheDocs| image:: https://readthedocs.org/projects/sprocketsamqp/badge/
   :target: https://sprocketsamqp.readthedocs.org<commit_msg>Fix the package name<commit_after>sprockets.mixins.avro-publisher
===============================
AMQP Publishing Mixin for publishing messages as Avro datum

|Version| |Downloads|

Installation
------------
``sprockets.mixins.avro-publisher`` is available on the
`Python Package Index <https://pypi.python.org/pypi/sprockets.mixins.avro-publisher>`_
and can be installed via ``pip`` or ``easy_install``:

.. code-block:: bash

   pip install sprockets.mixins.avro_publisher

Requirements
------------
- sprockets.mixins.amqp>=0.1.1

Example
-------
This examples demonstrates the most basic usage of ``sprockets.mixins.avro-publisher``

.. code:: bash

   export AMQP_URL="amqp://user:password@rabbitmq_host:5672/%2f"
   python my-example-app.py


.. code:: python

   import json

   from tornado import gen
   from tornado import web
   from sprockets.mixins import avro_publisher

   class RequestHandler(avro_publisher.AvroPublishingMixin, web.RequestHandler):

       @gen.coroutine
       def get(self, *args, **kwargs):
           body = {'request': self.request.path, 'args': args, 'kwargs': kwargs}
           yield self.amqp_publish('exchange', 'routing.key', json.dumps(body),
                                   {'content_type': avro_publisher.DATUM_MIME_TYPE,
                                    'type': 'avro-schema-name'


                                    })

   settings = {'avro_schema_uri_format': 'http://my-schema-repository/%(name)s.avsc'}
   application = web.Application([(r"/", RequestHandler),],
                                 debug=True,
                                 **settings)


   if __name__ == "__main__":
       application.listen(8888)
       logging.basicConfig(level=logging.INFO)
       ioloop.IOLoop.current().start()


Source
------
``sprockets.mixins.avro-publisher`` source is available on Github at `https://github.com/sprockets/sprockets.mixins.avro-publisher <https://github.com/sprockets/sprockets.mixins.avro_publisher>`_

License
-------
``sprockets.mixins.avro-publisher`` is released under the `3-Clause BSD license <https://github.com/sprockets/sprockets.mixins.avro-publisher/blob/master/LICENSE>`_.

.. |Version| image:: https://badge.fury.io/py/sprockets.mixins.avro-publisher.svg?
   :target: http://badge.fury.io/py/sprockets.mixins.avro-publisher

.. |Downloads| image:: https://pypip.in/d/sprockets.mixins.avro-publisher/badge.svg?
   :target: https://pypi.python.org/pypi/sprockets.mixins.avro-publisher
{'fraction_non_alphanumeric': 0.155389385372971, 'fraction_numerical': 0.0047419296005836225, 'mean_word_length': 3.107865168539326, 'pattern_counts': {'":': 2, '<': 9, '<?xml version=': 0, '>': 11, 'https://': 19, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 14, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2160853', 'n_tokens_mistral': 1899, 'n_tokens_neox': 1824, 'n_words': 292}