Development of an internal social media platform with personalised dashboards for students
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

METADATA 12KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364
  1. Metadata-Version: 2.0
  2. Name: kombu
  3. Version: 3.0.37
  4. Summary: Messaging library for Python
  5. Home-page: https://kombu.readthedocs.io
  6. Author: Ask Solem
  7. Author-email: ask@celeryproject.org
  8. License: UNKNOWN
  9. Platform: any
  10. Classifier: Development Status :: 5 - Production/Stable
  11. Classifier: License :: OSI Approved :: BSD License
  12. Classifier: Operating System :: OS Independent
  13. Classifier: Programming Language :: Python
  14. Classifier: Programming Language :: Python :: 3
  15. Classifier: Programming Language :: Python :: 3.4
  16. Classifier: Programming Language :: Python :: 3.3
  17. Classifier: Programming Language :: Python :: 2.7
  18. Classifier: Programming Language :: Python :: 2.6
  19. Classifier: Programming Language :: Python :: 2
  20. Classifier: Programming Language :: Python :: Implementation :: CPython
  21. Classifier: Programming Language :: Python :: Implementation :: PyPy
  22. Classifier: Programming Language :: Python :: Implementation :: Jython
  23. Classifier: Intended Audience :: Developers
  24. Classifier: Topic :: Communications
  25. Classifier: Topic :: System :: Distributed Computing
  26. Classifier: Topic :: System :: Networking
  27. Classifier: Topic :: Software Development :: Libraries :: Python Modules
  28. Requires-Dist: anyjson >= 0.3.3
  29. Requires-Dist: amqp >= 1.4.9,<2.0
  30. Requires-Dist: importlib; python_version == "2.6"
  31. Requires-Dist: ordereddict; python_version == "2.6"
  32. .. _kombu-index:
  33. ========================================
  34. kombu - Messaging library for Python
  35. ========================================
  36. :Version: 3.0.37
  37. `Kombu` is a messaging library for Python.
  38. The aim of `Kombu` is to make messaging in Python as easy as possible by
  39. providing an idiomatic high-level interface for the AMQ protocol, and also
  40. provide proven and tested solutions to common messaging problems.
  41. `AMQP`_ is the Advanced Message Queuing Protocol, an open standard protocol
  42. for message orientation, queuing, routing, reliability and security,
  43. for which the `RabbitMQ`_ messaging server is the most popular implementation.
  44. Features
  45. ========
  46. * Allows application authors to support several message server
  47. solutions by using pluggable transports.
  48. * AMQP transport using the `py-amqp`_, `librabbitmq`_, or `qpid-python`_ client libraries.
  49. * High performance AMQP transport written in C - when using `librabbitmq`_
  50. This is automatically enabled if librabbitmq is installed::
  51. $ pip install librabbitmq
  52. * Virtual transports makes it really easy to add support for non-AMQP
  53. transports. There is already built-in support for `Redis`_,
  54. `Beanstalk`_, `Amazon SQS`_, `CouchDB`_, `MongoDB`_, `ZeroMQ`_,
  55. `ZooKeeper`_, `SoftLayer MQ`_ and `Pyro`_.
  56. * You can also use the SQLAlchemy and Django ORM transports to
  57. use a database as the broker.
  58. * In-memory transport for unit testing.
  59. * Supports automatic encoding, serialization and compression of message
  60. payloads.
  61. * Consistent exception handling across transports.
  62. * The ability to ensure that an operation is performed by gracefully
  63. handling connection and channel errors.
  64. * Several annoyances with `amqplib`_ has been fixed, like supporting
  65. timeouts and the ability to wait for events on more than one channel.
  66. * Projects already using `carrot`_ can easily be ported by using
  67. a compatibility layer.
  68. For an introduction to AMQP you should read the article `Rabbits and warrens`_,
  69. and the `Wikipedia article about AMQP`_.
  70. .. _`RabbitMQ`: http://www.rabbitmq.com/
  71. .. _`AMQP`: http://amqp.org
  72. .. _`py-amqp`: http://pypi.python.org/pypi/amqp/
  73. .. _`qpid-python`: http://pypi.python.org/pypi/qpid-python/
  74. .. _`Redis`: http://code.google.com/p/redis/
  75. .. _`Amazon SQS`: http://aws.amazon.com/sqs/
  76. .. _`MongoDB`: http://www.mongodb.org/
  77. .. _`CouchDB`: http://couchdb.apache.org/
  78. .. _`ZeroMQ`: http://zeromq.org/
  79. .. _`Zookeeper`: https://zookeeper.apache.org/
  80. .. _`Beanstalk`: http://kr.github.com/beanstalkd/
  81. .. _`Rabbits and warrens`: http://blogs.digitar.com/jjww/2009/01/rabbits-and-warrens/
  82. .. _`amqplib`: http://barryp.org/software/py-amqplib/
  83. .. _`Wikipedia article about AMQP`: http://en.wikipedia.org/wiki/AMQP
  84. .. _`carrot`: http://pypi.python.org/pypi/carrot/
  85. .. _`librabbitmq`: http://pypi.python.org/pypi/librabbitmq
  86. .. _`Pyro`: http://pythonhosting.org/Pyro
  87. .. _`SoftLayer MQ`: http://www.softlayer.com/services/additional/message-queue
  88. .. _transport-comparison:
  89. Transport Comparison
  90. ====================
  91. +---------------+----------+------------+------------+---------------+
  92. | **Client** | **Type** | **Direct** | **Topic** | **Fanout** |
  93. +---------------+----------+------------+------------+---------------+
  94. | *amqp* | Native | Yes | Yes | Yes |
  95. +---------------+----------+------------+------------+---------------+
  96. | *qpid* | Native | Yes | Yes | Yes |
  97. +---------------+----------+------------+------------+---------------+
  98. | *redis* | Virtual | Yes | Yes | Yes (PUB/SUB) |
  99. +---------------+----------+------------+------------+---------------+
  100. | *mongodb* | Virtual | Yes | Yes | Yes |
  101. +---------------+----------+------------+------------+---------------+
  102. | *beanstalk* | Virtual | Yes | Yes [#f1]_ | No |
  103. +---------------+----------+------------+------------+---------------+
  104. | *SQS* | Virtual | Yes | Yes [#f1]_ | Yes [#f2]_ |
  105. +---------------+----------+------------+------------+---------------+
  106. | *couchdb* | Virtual | Yes | Yes [#f1]_ | No |
  107. +---------------+----------+------------+------------+---------------+
  108. | *zookeeper* | Virtual | Yes | Yes [#f1]_ | No |
  109. +---------------+----------+------------+------------+---------------+
  110. | *in-memory* | Virtual | Yes | Yes [#f1]_ | No |
  111. +---------------+----------+------------+------------+---------------+
  112. | *django* | Virtual | Yes | Yes [#f1]_ | No |
  113. +---------------+----------+------------+------------+---------------+
  114. | *sqlalchemy* | Virtual | Yes | Yes [#f1]_ | No |
  115. +---------------+----------+------------+------------+---------------+
  116. | *SLMQ* | Virtual | Yes | Yes [#f1]_ | No |
  117. +---------------+----------+------------+------------+---------------+
  118. .. [#f1] Declarations only kept in memory, so exchanges/queues
  119. must be declared by all clients that needs them.
  120. .. [#f2] Fanout supported via storing routing tables in SimpleDB.
  121. Disabled by default, but can be enabled by using the
  122. ``supports_fanout`` transport option.
  123. Documentation
  124. -------------
  125. Kombu is using Sphinx, and the latest documentation can be found here:
  126. https://kombu.readthedocs.io/
  127. Quick overview
  128. --------------
  129. ::
  130. from kombu import Connection, Exchange, Queue
  131. media_exchange = Exchange('media', 'direct', durable=True)
  132. video_queue = Queue('video', exchange=media_exchange, routing_key='video')
  133. def process_media(body, message):
  134. print body
  135. message.ack()
  136. # connections
  137. with Connection('amqp://guest:guest@localhost//') as conn:
  138. # produce
  139. producer = conn.Producer(serializer='json')
  140. producer.publish({'name': '/tmp/lolcat1.avi', 'size': 1301013},
  141. exchange=media_exchange, routing_key='video',
  142. declare=[video_queue])
  143. # the declare above, makes sure the video queue is declared
  144. # so that the messages can be delivered.
  145. # It's a best practice in Kombu to have both publishers and
  146. # consumers declare the queue. You can also declare the
  147. # queue manually using:
  148. # video_queue(conn).declare()
  149. # consume
  150. with conn.Consumer(video_queue, callbacks=[process_media]) as consumer:
  151. # Process messages and handle events on all channels
  152. while True:
  153. conn.drain_events()
  154. # Consume from several queues on the same channel:
  155. video_queue = Queue('video', exchange=media_exchange, key='video')
  156. image_queue = Queue('image', exchange=media_exchange, key='image')
  157. with connection.Consumer([video_queue, image_queue],
  158. callbacks=[process_media]) as consumer:
  159. while True:
  160. connection.drain_events()
  161. Or handle channels manually::
  162. with connection.channel() as channel:
  163. producer = Producer(channel, ...)
  164. consumer = Producer(channel)
  165. All objects can be used outside of with statements too,
  166. just remember to close the objects after use::
  167. from kombu import Connection, Consumer, Producer
  168. connection = Connection()
  169. # ...
  170. connection.release()
  171. consumer = Consumer(channel_or_connection, ...)
  172. consumer.register_callback(my_callback)
  173. consumer.consume()
  174. # ....
  175. consumer.cancel()
  176. `Exchange` and `Queue` are simply declarations that can be pickled
  177. and used in configuration files etc.
  178. They also support operations, but to do so they need to be bound
  179. to a channel.
  180. Binding exchanges and queues to a connection will make it use
  181. that connections default channel.
  182. ::
  183. >>> exchange = Exchange('tasks', 'direct')
  184. >>> connection = Connection()
  185. >>> bound_exchange = exchange(connection)
  186. >>> bound_exchange.delete()
  187. # the original exchange is not affected, and stays unbound.
  188. >>> exchange.delete()
  189. raise NotBoundError: Can't call delete on Exchange not bound to
  190. a channel.
  191. Installation
  192. ============
  193. You can install `Kombu` either via the Python Package Index (PyPI)
  194. or from source.
  195. To install using `pip`,::
  196. $ pip install kombu
  197. To install using `easy_install`,::
  198. $ easy_install kombu
  199. If you have downloaded a source tarball you can install it
  200. by doing the following,::
  201. $ python setup.py build
  202. # python setup.py install # as root
  203. Terminology
  204. ===========
  205. There are some concepts you should be familiar with before starting:
  206. * Producers
  207. Producers sends messages to an exchange.
  208. * Exchanges
  209. Messages are sent to exchanges. Exchanges are named and can be
  210. configured to use one of several routing algorithms. The exchange
  211. routes the messages to consumers by matching the routing key in the
  212. message with the routing key the consumer provides when binding to
  213. the exchange.
  214. * Consumers
  215. Consumers declares a queue, binds it to a exchange and receives
  216. messages from it.
  217. * Queues
  218. Queues receive messages sent to exchanges. The queues are declared
  219. by consumers.
  220. * Routing keys
  221. Every message has a routing key. The interpretation of the routing
  222. key depends on the exchange type. There are four default exchange
  223. types defined by the AMQP standard, and vendors can define custom
  224. types (so see your vendors manual for details).
  225. These are the default exchange types defined by AMQP/0.8:
  226. * Direct exchange
  227. Matches if the routing key property of the message and
  228. the `routing_key` attribute of the consumer are identical.
  229. * Fan-out exchange
  230. Always matches, even if the binding does not have a routing
  231. key.
  232. * Topic exchange
  233. Matches the routing key property of the message by a primitive
  234. pattern matching scheme. The message routing key then consists
  235. of words separated by dots (`"."`, like domain names), and
  236. two special characters are available; star (`"*"`) and hash
  237. (`"#"`). The star matches any word, and the hash matches
  238. zero or more words. For example `"*.stock.#"` matches the
  239. routing keys `"usd.stock"` and `"eur.stock.db"` but not
  240. `"stock.nasdaq"`.
  241. Getting Help
  242. ============
  243. Mailing list
  244. ------------
  245. Join the `carrot-users`_ mailing list.
  246. .. _`carrot-users`: http://groups.google.com/group/carrot-users/
  247. Bug tracker
  248. ===========
  249. If you have any suggestions, bug reports or annoyances please report them
  250. to our issue tracker at http://github.com/celery/kombu/issues/
  251. Contributing
  252. ============
  253. Development of `Kombu` happens at Github: http://github.com/celery/kombu
  254. You are highly encouraged to participate in the development. If you don't
  255. like Github (for some reason) you're welcome to send regular patches.
  256. License
  257. =======
  258. This software is licensed under the `New BSD License`. See the `LICENSE`
  259. file in the top distribution directory for the full license text.
  260. .. image:: https://d2weczhvl823v0.cloudfront.net/celery/kombu/trend.png
  261. :alt: Bitdeli badge
  262. :target: https://bitdeli.com/free