{ "info": { "author": "Isaac Dickinson", "author_email": "sun@veriny.tf", "bugtrack_url": null, "classifiers": [ "Development Status :: 5 - Production/Stable", "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Operating System :: POSIX", "Programming Language :: Python", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.3", "Programming Language :: Python :: 3.4", "Programming Language :: Python :: 3.5", "Topic :: Software Development", "Topic :: Software Development :: Libraries" ], "description": "Kohlrabi\n--------\n\n*Kohlrabi* is a asynchronous task queue for Python applications. It runs\non top of a Redis server, and fits in with any existing application that\nruns on Python 3.3 or higher. It allows easy converting of parts of\napplications to asyncio-compatible parts, without affecting any normal\nblocking code.\n\nInstallation\n~~~~~~~~~~~~\n\nKohlrabi is available on PyPI to install easily:\n\n::\n\n pip install kohlrabi\n\nOr, you can install it from GitHub directly:\n\n::\n\n pip install https://github.com/SunDwarf/Kohlrabi.git@master\n\nUsage\n~~~~~\n\nKohlrabi comes in two parts - the client and the server.\n\nA single object is shared by both sides, and should be defined in your\nmain file.\n\n.. code:: python\n\n kh = kohlrabi.Kohlrabi()\n\nWhen running the server, this object must be specified in a specific\nformat on the command line:\n\n::\n\n kohlrabi-server yourapp.mainfile:kh\n\n| The first part before the ``:`` represents the *import path* of the\n module; how you would load it if you were to import it. The second\n part represents the Kohlrabi object created previously.\n| This will then load the Kohlrabi server, and load the tasks on the\n server-side.\n\nIn your app code, using Kohlrabi is incredibly simple.\n\nCreating tasks\n^^^^^^^^^^^^^^\n\nTo create a task, simply decorate a function with Kohlrabi task\ndecorator.\n\n.. code:: python\n\n @kh.task\n def hello():\n print(\"Hello, world!\")\n\nThen, inside your main method (or ``__name__`` check), call the task as\nif it was a function.\n\n.. code:: python\n\n if __name__ == \"__main__\":\n hello()\n\nIf you check the console of the server process, it will have printed\n``Hello, world!``.\n\nMore advanced tasks\n^^^^^^^^^^^^^^^^^^^\n\nAn example of a more advanced task would be an addition task.\n\n.. code:: python\n\n @kh.task\n def add(a, b):\n return a + b\n\nInside your main method, call the add task with the parameters chosen:\n\n.. code:: python\n\n fut = add(1, 2)\n\nThis returns a ClientTaskResult object, which you can use to get the\nresult of the task.\n\n.. code:: python\n\n print(\"Added together 1 and 2 to get:\", fut.result)\n\nNote that ``ClientTaskResult.result`` is blocking, and will wait until\nthe task has finished to get the result of the task. If you wish to only\nwait a certain amount of time, use the\n``ClientTaskResult.result_with_timeout`` method.\n\n.. code:: python\n\n print(\"Added together 1 and 2 to get:\", fut.result_with_timeout(1))\n\nChaining tasks\n^^^^^^^^^^^^^^\n\nIf you wish to chain tasks together, use the ``yield from`` keywords. On\nthe server side, a task is just a wrapped coroutine, meaning you can use\nit as if it was a coroutine.\n\n.. code:: python\n\n @kh.task\n def add_two(a):\n return a + 2\n\n @kh.task\n def get_four():\n four = yield from add_two(2)\n return four\n", "description_content_type": null, "docs_url": null, "download_url": "UNKNOWN", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/SunDwarf/Kohlrabi", "keywords": null, "license": "MIT", "maintainer": null, "maintainer_email": null, "name": "Kohlrabi", "package_url": "https://pypi.org/project/Kohlrabi/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/Kohlrabi/", "project_urls": { "Download": "UNKNOWN", "Homepage": "https://github.com/SunDwarf/Kohlrabi" }, "release_url": "https://pypi.org/project/Kohlrabi/1.0.0/", "requires_dist": null, "requires_python": null, "summary": "An asyncio-based task queue.", "version": "1.0.0" }, "last_serial": 2040648, "releases": { "1.0.0": [ { "comment_text": "built for Linux-4.5.0-1-ARCH-x86_64-with-glibc2.3.4", "digests": { "md5": "df5210d49a5c0830d636a9a63a49e43b", "sha256": "d9dddbf0432bc82f1a21509a8c81cb52db934ba67c47a1da761f8c32716ea7a1" }, "downloads": -1, "filename": "Kohlrabi-1.0.0.linux-x86_64.tar.gz", "has_sig": true, "md5_digest": "df5210d49a5c0830d636a9a63a49e43b", "packagetype": "bdist_dumb", "python_version": "any", "requires_python": null, "size": 11955, "upload_time": "2016-04-01T16:38:24", "url": "https://files.pythonhosted.org/packages/ff/75/5179669547809d12e199002e505728abee3fd99f0cecd92bcc686f50f3f4/Kohlrabi-1.0.0.linux-x86_64.tar.gz" }, { "comment_text": "", "digests": { "md5": "4d880c2d8c54ceae3a0600e13482c23b", "sha256": "500e6cff1c1cfe62637358ec76a10a2893c5eb7eed1010db6b126202fc79b855" }, "downloads": -1, "filename": "Kohlrabi-1.0.0-py3-none-any.whl", "has_sig": true, "md5_digest": "4d880c2d8c54ceae3a0600e13482c23b", "packagetype": "bdist_wheel", "python_version": "3.5", "requires_python": null, "size": 8946, "upload_time": "2016-04-01T16:38:30", "url": "https://files.pythonhosted.org/packages/fb/da/753e44c4ce3b9515c9a9de5f4ad75d90da88c2a72168960ffacd957add8a/Kohlrabi-1.0.0-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "b0f718bed90803b1b566a5ef0a6cb877", "sha256": "0fad419b1f33ef5787f18aa3891d9269c8d9295ff4df3e48893b32e49e897635" }, "downloads": -1, "filename": "Kohlrabi-1.0.0.tar.gz", "has_sig": true, "md5_digest": "b0f718bed90803b1b566a5ef0a6cb877", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6728, "upload_time": "2016-04-01T16:38:16", "url": "https://files.pythonhosted.org/packages/85/4d/9fe2c64d72a594df5281121306192f29b50e18c29fb7ef574ab7ca989a28/Kohlrabi-1.0.0.tar.gz" } ] }, "urls": [ { "comment_text": "built for Linux-4.5.0-1-ARCH-x86_64-with-glibc2.3.4", "digests": { "md5": "df5210d49a5c0830d636a9a63a49e43b", "sha256": "d9dddbf0432bc82f1a21509a8c81cb52db934ba67c47a1da761f8c32716ea7a1" }, "downloads": -1, "filename": "Kohlrabi-1.0.0.linux-x86_64.tar.gz", "has_sig": true, "md5_digest": "df5210d49a5c0830d636a9a63a49e43b", "packagetype": "bdist_dumb", "python_version": "any", "requires_python": null, "size": 11955, "upload_time": "2016-04-01T16:38:24", "url": "https://files.pythonhosted.org/packages/ff/75/5179669547809d12e199002e505728abee3fd99f0cecd92bcc686f50f3f4/Kohlrabi-1.0.0.linux-x86_64.tar.gz" }, { "comment_text": "", "digests": { "md5": "4d880c2d8c54ceae3a0600e13482c23b", "sha256": "500e6cff1c1cfe62637358ec76a10a2893c5eb7eed1010db6b126202fc79b855" }, "downloads": -1, "filename": "Kohlrabi-1.0.0-py3-none-any.whl", "has_sig": true, "md5_digest": "4d880c2d8c54ceae3a0600e13482c23b", "packagetype": "bdist_wheel", "python_version": "3.5", "requires_python": null, "size": 8946, "upload_time": "2016-04-01T16:38:30", "url": "https://files.pythonhosted.org/packages/fb/da/753e44c4ce3b9515c9a9de5f4ad75d90da88c2a72168960ffacd957add8a/Kohlrabi-1.0.0-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "b0f718bed90803b1b566a5ef0a6cb877", "sha256": "0fad419b1f33ef5787f18aa3891d9269c8d9295ff4df3e48893b32e49e897635" }, "downloads": -1, "filename": "Kohlrabi-1.0.0.tar.gz", "has_sig": true, "md5_digest": "b0f718bed90803b1b566a5ef0a6cb877", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6728, "upload_time": "2016-04-01T16:38:16", "url": "https://files.pythonhosted.org/packages/85/4d/9fe2c64d72a594df5281121306192f29b50e18c29fb7ef574ab7ca989a28/Kohlrabi-1.0.0.tar.gz" } ] }