{ "info": { "author": "Motoki Naruse", "author_email": "motoki@naru.se", "bugtrack_url": null, "classifiers": [ "Development Status :: 1 - Planning", "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.4", "Programming Language :: Python :: 3.5", "Programming Language :: Python :: 3.6", "Programming Language :: Python :: 3 :: Only", "Topic :: Software Development :: Libraries" ], "description": "========\nBrokkoly\n========\n\n.. image:: https://travis-ci.org/narusemotoki/brokkoly.svg?branch=master\n :target: https://travis-ci.org/narusemotoki/brokkoly\n\nBrokkoly is a framework for enqueuing messages via HTTP request for celery.\n\n`CHANGELOG `_\n\nExample\n=======\n\ntasks.py:\n---------\n\n.. code-block:: python\n\n import brokkoly\n\n b = brokkoly.Brokkoly('example', 'redis://localhost:6379/0')\n celery = b.celery\n\n\n def two_times(text: str) -> dict:\n return {\n 'text': text * 2\n }\n \n \n @b.task(two_times)\n def echo(text: str) -> None:\n print(text)\n\n:code:`two_times` works as pre processor. It works before enqueing. It means it can return BadRequest to your client. Brokkoly validate message with typehint. Also you can have extra validation and any other process here.\n\nRun :code:`celery -A tasks worker --loglevel=info`\n\nproducer.py:\n------------\n\n.. code-block:: python\n\n import brokkoly\n\n import tasks # NOQA\n\n application = brokkoly.producer()\n\n`producer` is WSGI application. You need to import your `tasks` for put message into queue.\n\nRun with uWSGI :code:`uwsgi --http :8080 --wsgi-file producer.py --enable-threads --thunder-lock --master`\n\nSend Test Message!\n------------------\n\n:code:`curl -X POST -d '{\"message\":{\"text\": \"Hello\"}}' http://localhost:8080/example/echo`\n\n1. `producer` receives your request\n2. `producer` validates your message having `text` and the type is `str` or not. `text`(str)` is from typehint of :code:`two_times`\n3. `producer` validates `two_times` returned value having `text` and the type is `str` or not. `text`(str)` is from typehint of :code:`echo`\n4. `producer` put message :code:`{\"message\":{\"text\":\"HelloHello\"}}` into queue.\n5. `curl` receives response.\n6. `Celery` calls :code:`echo`\n\n\nExtra\n=====\n\npreprocessor is optional. if you don't need it, you can:\n\n.. code-block:: python\n\n @b.task()\n def echo(text: str) -> None:\n print(text)\n\nAlso you can give multiple preprocessor:\n\n.. code-block:: python\n\n @b.task(two_times, two_times)\n def echo(text: str) -> None:\n print(text)\n", "description_content_type": null, "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/narusemotoki/brokkoly", "keywords": "celery", "license": "MIT", "maintainer": "", "maintainer_email": "", "name": "brokkoly", "package_url": "https://pypi.org/project/brokkoly/", "platform": "", "project_url": "https://pypi.org/project/brokkoly/", "project_urls": { "Homepage": "https://github.com/narusemotoki/brokkoly" }, "release_url": "https://pypi.org/project/brokkoly/0.3.1/", "requires_dist": null, "requires_python": "", "summary": "Brokkoly is a framework for enqueuing messages via HTTP request for celery.", "version": "0.3.1" }, "last_serial": 2999018, "releases": { "0.0.1": [ { "comment_text": "", "digests": { "md5": "3bff0b522de82c54868c6f72a8abe9a4", "sha256": "6b7bf350fbc75ba35d51279ef44a5bab41c462afa0ae7b52f2941bca3ab9a0fa" }, "downloads": -1, "filename": "brokkoly-0.0.1.tar.gz", "has_sig": false, "md5_digest": "3bff0b522de82c54868c6f72a8abe9a4", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3749, "upload_time": "2017-02-03T15:11:54", "url": "https://files.pythonhosted.org/packages/f1/96/58d9d5dde673cd37a34db633a1c6d73b74fc340f564be9a47c968f2f0902/brokkoly-0.0.1.tar.gz" } ], "0.0.2": [ { "comment_text": "", "digests": { "md5": "db209d55908f6e560cdd3c39b51a22f8", "sha256": "e17f7ee759256af9f79298117396c2401d1cbb58645f1b04c95ddd3b0bc671e8" }, "downloads": -1, "filename": "brokkoly-0.0.2.tar.gz", "has_sig": false, "md5_digest": "db209d55908f6e560cdd3c39b51a22f8", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3791, "upload_time": "2017-02-03T15:51:17", "url": "https://files.pythonhosted.org/packages/8f/f6/b8500b7323a3dd3a7ec92218572a8b318527eb417f65ec8dc999f0a16d28/brokkoly-0.0.2.tar.gz" } ], "0.1.0": [ { "comment_text": "", "digests": { "md5": "dc4312afb687b957d4924d1b5124519a", "sha256": "cb56bdfb5b6b6afe1bee5be6faa91958bb63ddaeb304384b4e3539cc3047069c" }, "downloads": -1, "filename": "brokkoly-0.1.0.tar.gz", "has_sig": false, "md5_digest": "dc4312afb687b957d4924d1b5124519a", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6222, "upload_time": "2017-02-05T13:52:42", "url": "https://files.pythonhosted.org/packages/c0/08/106a12f828e90b48ea6acd8d018b128c8aaa21b4297a04e1d907d1c9a848/brokkoly-0.1.0.tar.gz" } ], "0.2.0": [ { "comment_text": "", "digests": { "md5": "00531b8e7b51cde0538b7976a9bdc6fb", "sha256": "6c8ef57bb7be4ddd4ee8ec49c940a69ed5a3662473fde11a8284b1c1930d91b6" }, "downloads": -1, "filename": "brokkoly-0.2.0.tar.gz", "has_sig": false, "md5_digest": "00531b8e7b51cde0538b7976a9bdc6fb", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 10253, "upload_time": "2017-02-07T16:11:47", "url": "https://files.pythonhosted.org/packages/c9/85/c7a28a4d92815bcde97149ff950bea0d6c7c40271fca29d5169a2d093e1f/brokkoly-0.2.0.tar.gz" } ], "0.3.0": [ { "comment_text": "", "digests": { "md5": "325535f041e0dfb4ecddb670da12a814", "sha256": "bcafb602b98291e310388435c33e385b0f590e70ec6c4293718a45c91b2cfd85" }, "downloads": -1, "filename": "brokkoly-0.3.0.tar.gz", "has_sig": false, "md5_digest": "325535f041e0dfb4ecddb670da12a814", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 10812, "upload_time": "2017-03-09T00:10:00", "url": "https://files.pythonhosted.org/packages/5d/44/66fc879b22ce5903d877139672d412c1c76c3dda6338ff2900ab3d704ba0/brokkoly-0.3.0.tar.gz" } ], "0.3.1": [ { "comment_text": "", "digests": { "md5": "a4a42bf82c856c15ee54114dd09ddebd", "sha256": "db45bcdc3c9db4b777fd462e792569c2a363af410dc6b5bdd33c6fa9efa5aeac" }, "downloads": -1, "filename": "brokkoly-0.3.1.tar.gz", "has_sig": false, "md5_digest": "a4a42bf82c856c15ee54114dd09ddebd", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 11696, "upload_time": "2017-07-04T12:22:23", "url": "https://files.pythonhosted.org/packages/de/58/5d047be1bceaa48bd37dd5c809294254adea0a873f00a66461c53bf8724f/brokkoly-0.3.1.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "a4a42bf82c856c15ee54114dd09ddebd", "sha256": "db45bcdc3c9db4b777fd462e792569c2a363af410dc6b5bdd33c6fa9efa5aeac" }, "downloads": -1, "filename": "brokkoly-0.3.1.tar.gz", "has_sig": false, "md5_digest": "a4a42bf82c856c15ee54114dd09ddebd", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 11696, "upload_time": "2017-07-04T12:22:23", "url": "https://files.pythonhosted.org/packages/de/58/5d047be1bceaa48bd37dd5c809294254adea0a873f00a66461c53bf8724f/brokkoly-0.3.1.tar.gz" } ] }