{ "info": { "author": "jssuzanne", "author_email": "jssuzanne@anybox.fr", "bugtrack_url": null, "classifiers": [ "Development Status :: 5 - Production/Stable", "Intended Audience :: Developers", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.4", "Programming Language :: Python :: 3.5", "Programming Language :: Python :: 3.6", "Programming Language :: Python :: 3.7", "Programming Language :: Python :: 3.8" ], "description": ".. This file is a part of the AnyBlok / Bus project\n..\n.. Copyright (C) 2018 Jean-Sebastien SUZANNE \n..\n.. This Source Code Form is subject to the terms of the Mozilla Public License,\n.. v. 2.0. If a copy of the MPL was not distributed with this file,You can\n.. obtain one at http://mozilla.org/MPL/2.0/.\n\n.. image:: https://img.shields.io/pypi/pyversions/anyblok_bus.svg?longCache=True\n :alt: Python versions\n\n.. image:: https://travis-ci.org/AnyBlok/anyblok_bus.svg?branch=master\n :target: https://travis-ci.org/AnyBlok/anyblok_bus\n :alt: Build status\n\n.. image:: https://coveralls.io/repos/github/AnyBlok/anyblok_bus/badge.svg?branch=master\n :target: https://coveralls.io/github/AnyBlok/anyblok_bus?branch=master\n :alt: Coverage\n\n.. image:: https://img.shields.io/pypi/v/anyblok_bus.svg\n :target: https://pypi.python.org/pypi/anyblok_bus/\n :alt: Version status\n\n.. image:: https://readthedocs.org/projects/anyblok-bus/badge/?version=latest\n :alt: Documentation Status\n :scale: 100%\n :target: https://doc.anyblok-bus.anyblok.org/?badge=latest\n\n\nAnyBlok / bus\n=============\n\nImprove `AnyBlok `_ to add comunication with bus.\n\n+---------+--------------+------------------------------------------------------------------+\n| Blok | Dependancies | Description |\n+=========+==============+==================================================================+\n| **bus** | | Consume and publish message with |\n| | | `pika `_ and |\n| | | `marshmallow `_ |\n+---------+--------------+------------------------------------------------------------------+\n\nAnyBlok / Bus is released under the terms of the `Mozilla Public License`.\n\nSee the `latest documentation `_\n\n.. This file is a part of the AnyBlok / Bus project\n..\n.. Copyright (C) 2018 Jean-Sebastien SUZANNE \n..\n.. This Source Code Form is subject to the terms of the Mozilla Public License,\n.. v. 2.0. If a copy of the MPL was not distributed with this file,You can\n.. obtain one at http://mozilla.org/MPL/2.0/.\n\n.. contents::\n\nUsage\n=====\n\nDeclare a new consumer\n----------------------\n\nIn an AnyBlok Model you have to decorate a method with **bus_consumer**\n\n::\n\n from anyblok_bus import bus_consumer\n from anyblok import Declarations\n from .schema import MySchema\n\n @Declarations.register(Declarations.Model)\n class MyModel:\n\n @bus_consumer(queue_name='name of the queue', schema=MySchema())\n def my_consumer(cls, body):\n # do something\n\n\nThe schema must be an instance of marshmallow.Schema, `see the marshmallow documentation `_\n\n.. note:: \n\n The decorated method become a classmethod with always the same prototype (cls, body)\n body is the desarialization of the message from the queue by the schema.\n\n\nPublish a message through rabbitmq\n----------------------------------\n\nThe publication is done by **registry.Bus.publish** method::\n\n registry.Bus.publish('exchange', 'routing_key', message, mimestype)\n\nif the message have not be send, then an exception is raised\n\n..warning::\n\n A profile must be defined and selected by the AnyBlok configuration **bus_profile**\n\n.. This file is a part of the AnyBlok / Bus project\n..\n.. Copyright (C) 2017 Jean-Sebastien SUZANNE \n.. Copyright (C) 2018 Jean-Sebastien SUZANNE \n.. Copyright (C) 2019 Jean-Sebastien SUZANNE \n..\n.. This Source Code Form is subject to the terms of the Mozilla Public License,\n.. v. 2.0. If a copy of the MPL was not distributed with this file,You can\n.. obtain one at http://mozilla.org/MPL/2.0/.\n\nFront Matter\n============\n\nInformation about the AnyBlok / Bus project.\n\nProject Homepage\n----------------\n\nAnyBlok is hosted on `github `_ - the main project\npage is at https://github.com/AnyBlok/anyblok_bus. Source code is\ntracked here using `GIT `_.\n\nReleases and project status are available on Pypi at\nhttp://pypi.python.org/pypi/anyblok_bus.\n\nThe most recent published version of this documentation should be at\nhttp://doc.anyblok-bus.anyblok.org.\n\nInstallation\n------------\n\nInstall released versions of AnyBlok from the Python package index with\n`pip `_ or a similar tool::\n\n pip install anyblok_bus\n\nInstallation via source distribution is via the ``setup.py`` script::\n\n python setup.py install\n\nInstallation will add the ``anyblok`` commands to the environment.\n\nUnit Test\n---------\n\nRun the test with ``nose``::\n\n pip install nose\n nosetests anyblok_bus/tests\n\nScript\n------\n\nanyblok_bus add ``console_script`` to launch worker. A worker consume a queue defined\nby the decorator **anyblok_bus.bus_consumer**::\n\n anyblok_bus -c anyblok_config_file.cfg\n\n..note:: The profile name in the configuration is used to find the correct url to connect to rabbitmq\n\nDependencies\n------------\n\nAnyBlok / Bus works with **Python >= 3.4** and later and `pika >= 1.0.1 `_. The install process will\nensure that `AnyBlok `_ is installed, in addition to other \ndependencies. The latest version of them is strongly recommended.\n\nAuthor\n------\n\nJean-S\u00e9bastien Suzanne\n\nContributors\n------------\n\n`Anybox `_ team:\n\n* Jean-S\u00e9bastien Suzanne\n* Florent Jouatte\n\n`Sensee `_ team:\n\n* Julien SZKUDLAPSKI\n* Jean-S\u00e9bastien Suzanne\n\nBugs\n----\n\nBugs and feature enhancements to AnyBlok should be reported on the `Issue\ntracker `_.\n\n.. This file is a part of the AnyBlok / Bus project\n..\n.. Copyright (C) 2018 Jean-Sebastien SUZANNE \n.. Copyright (C) 2019 Jean-Sebastien SUZANNE \n..\n.. This Source Code Form is subject to the terms of the Mozilla Public License,\n.. v. 2.0. If a copy of the MPL was not distributed with this file,You can\n.. obtain one at http://mozilla.org/MPL/2.0/.\n\n.. contents::\n\nCHANGELOG\n=========\n\n1.2.0 (2019-06-24)\n------------------\n\n* Update version to use pika >= 1.0.1\n* Fixed Multiple consumer on the same model\n* Refactored bus console script, Added processes parameter on bus_consumer.\n The goal is to define processes for one queue, by default all the queues \n are in the same process\n* Add better logging when a queue is missing. If a queue is missing, then\n workers won't start.\n* Added adapter parameter to transform bus message, the schema attribute\n become now a simple kwargs argument give to adapter.\n\n The adapter is not required.\n\n .. note::\n \n To keep the compatibility, if no adapter is defined with a schema then\n the adapter is schema_adapter\n\n1.1.0 (2018-09-15)\n------------------\n\n* Improved logging: for helping to debug the messages\n* Added create and update date columns\n* fixed ``consume_all`` method. now the method does not stop when an exception is raised\n* Used marsmallow version >= 3.0.0\n\n1.0.0 (2018-06-05)\n------------------\n\n* add Worker to consume the message from rabbitmq\n* add publish method to publish a message to rabbitmq\n* add **anyblok_bus.bus_consumer** add decorator to d\u00e9fine the consumer\n", "description_content_type": "", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "http://docs.anyblok-bus.anyblok.org/1.2.0", "keywords": "bus", "license": "", "maintainer": "", "maintainer_email": "", "name": "anyblok_bus", "package_url": "https://pypi.org/project/anyblok_bus/", "platform": "", "project_url": "https://pypi.org/project/anyblok_bus/", "project_urls": { "Homepage": "http://docs.anyblok-bus.anyblok.org/1.2.0" }, "release_url": "https://pypi.org/project/anyblok_bus/1.2.0/", "requires_dist": null, "requires_python": "", "summary": "Bus for anyblok", "version": "1.2.0" }, "last_serial": 5441548, "releases": { "0.1.0": [ { "comment_text": "", "digests": { "md5": "d4b1b1da1bdb4a54275a36b71423166a", "sha256": "5b698aa529503b8859fa9007a706632606da2f7a80cb7c7d246b044bda71cc4f" }, "downloads": -1, "filename": "anyblok_bus-0.1.0-py3-none-any.whl", "has_sig": false, "md5_digest": "d4b1b1da1bdb4a54275a36b71423166a", "packagetype": "bdist_wheel", "python_version": "3.5", "requires_python": null, "size": 21192, "upload_time": "2018-06-05T09:20:37", "url": "https://files.pythonhosted.org/packages/cb/db/957842fd8c1fb830d128da91c8190341d9957db94051191bd9be2764f5e6/anyblok_bus-0.1.0-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "c4bdecae52d65502f9fe284213200844", "sha256": "6eca4874ca0ccba8409244608c1a103f8a2fbcb3e258f5b4e9b246b46e8bd780" }, "downloads": -1, "filename": "anyblok_bus-0.1.0.tar.gz", "has_sig": false, "md5_digest": "c4bdecae52d65502f9fe284213200844", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 14446, "upload_time": "2018-06-05T09:20:35", "url": "https://files.pythonhosted.org/packages/3d/4a/509cf36dffe4f220ac87d9856d8e7e1c34179166cd7202f944bb3d9b7129/anyblok_bus-0.1.0.tar.gz" } ], "1.0.0": [ { "comment_text": "", "digests": { "md5": "4e0550da8b24054092cc7b05751d86d2", "sha256": "2a8a3da2f6cfe317f2a27194b9c2f84896674ba8b990f5644c25c357607c8572" }, "downloads": -1, "filename": "anyblok_bus-1.0.0-py3-none-any.whl", "has_sig": false, "md5_digest": "4e0550da8b24054092cc7b05751d86d2", "packagetype": "bdist_wheel", "python_version": "3.5", "requires_python": null, "size": 21195, "upload_time": "2018-06-05T09:22:05", "url": "https://files.pythonhosted.org/packages/8f/70/38e077678440fa58bfafe285f580e31e65725dc5d96c3512ce2d306a3ce5/anyblok_bus-1.0.0-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "3d13f2ce3a0285924ad70d098859bbf7", "sha256": "7edbf2b2ae2685ebcead1ee3f0cdfcd4ff594c1217cd95f34866f50b7c26baf7" }, "downloads": -1, "filename": "anyblok_bus-1.0.0.tar.gz", "has_sig": false, "md5_digest": "3d13f2ce3a0285924ad70d098859bbf7", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 14446, "upload_time": "2018-06-05T09:22:02", "url": "https://files.pythonhosted.org/packages/e0/e6/7a6223f2c94f658e31e5ba95eb8daac8460fd222a5a6cdb0e7f0c24d7700/anyblok_bus-1.0.0.tar.gz" } ], "1.1.0": [ { "comment_text": "", "digests": { "md5": "94a386f1458d4c2139e2e8402b6ffed1", "sha256": "ef8adfc9a758e2630af40f6b6e12388fc6b4ed6891f663d98e0630e9f25db074" }, "downloads": -1, "filename": "anyblok_bus-1.1.0-py3-none-any.whl", "has_sig": false, "md5_digest": "94a386f1458d4c2139e2e8402b6ffed1", "packagetype": "bdist_wheel", "python_version": "3.5", "requires_python": null, "size": 21876, "upload_time": "2018-09-15T08:50:39", "url": "https://files.pythonhosted.org/packages/a5/d6/98fe909d880c707b5da4b2a2ea201ba33c4678cb0c9126b95b0cc3201c7a/anyblok_bus-1.1.0-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "747f3085124b06ced7594882a0041f47", "sha256": "61763fa1db99aa627b552b70064feec4890389bc445f3f5536b9f6502d27b76a" }, "downloads": -1, "filename": "anyblok_bus-1.1.0.tar.gz", "has_sig": false, "md5_digest": "747f3085124b06ced7594882a0041f47", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 15261, "upload_time": "2018-09-15T08:50:36", "url": "https://files.pythonhosted.org/packages/96/e0/fd75fb001460dd6d2c36d7471bc9f89533a8b9f52bbf029b54c929367cda/anyblok_bus-1.1.0.tar.gz" } ], "1.2.0": [ { "comment_text": "", "digests": { "md5": "8ba3eaab9692f8396f6def2d8d1b2a6b", "sha256": "20671d1b280813fae9726a0119e320c8e667be24b849ccd88327c4a4cf99151d" }, "downloads": -1, "filename": "anyblok_bus-1.2.0-py3-none-any.whl", "has_sig": false, "md5_digest": "8ba3eaab9692f8396f6def2d8d1b2a6b", "packagetype": "bdist_wheel", "python_version": "3.5", "requires_python": null, "size": 28780, "upload_time": "2019-06-24T16:40:49", "url": "https://files.pythonhosted.org/packages/80/d8/d4d955b7a73178524ed20d0c8773a9877c3f1f4c5f5947d68507e7d40989/anyblok_bus-1.2.0-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "c1f42ec78cf4de285f2b7dba23f6e3f6", "sha256": "a3ba26c4323aeb462dc9f284b35d19079e5d1df96d1428a338a72e6b1c9786df" }, "downloads": -1, "filename": "anyblok_bus-1.2.0.tar.gz", "has_sig": false, "md5_digest": "c1f42ec78cf4de285f2b7dba23f6e3f6", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 19882, "upload_time": "2019-06-24T16:40:46", "url": "https://files.pythonhosted.org/packages/11/fc/19577f8458559479e6005fa296df9d36648c2f1a4acc70059f815c9f3769/anyblok_bus-1.2.0.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "8ba3eaab9692f8396f6def2d8d1b2a6b", "sha256": "20671d1b280813fae9726a0119e320c8e667be24b849ccd88327c4a4cf99151d" }, "downloads": -1, "filename": "anyblok_bus-1.2.0-py3-none-any.whl", "has_sig": false, "md5_digest": "8ba3eaab9692f8396f6def2d8d1b2a6b", "packagetype": "bdist_wheel", "python_version": "3.5", "requires_python": null, "size": 28780, "upload_time": "2019-06-24T16:40:49", "url": "https://files.pythonhosted.org/packages/80/d8/d4d955b7a73178524ed20d0c8773a9877c3f1f4c5f5947d68507e7d40989/anyblok_bus-1.2.0-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "c1f42ec78cf4de285f2b7dba23f6e3f6", "sha256": "a3ba26c4323aeb462dc9f284b35d19079e5d1df96d1428a338a72e6b1c9786df" }, "downloads": -1, "filename": "anyblok_bus-1.2.0.tar.gz", "has_sig": false, "md5_digest": "c1f42ec78cf4de285f2b7dba23f6e3f6", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 19882, "upload_time": "2019-06-24T16:40:46", "url": "https://files.pythonhosted.org/packages/11/fc/19577f8458559479e6005fa296df9d36648c2f1a4acc70059f815c9f3769/anyblok_bus-1.2.0.tar.gz" } ] }