{ "info": { "author": "Caleb Hattingh", "author_email": "caleb.hattingh@gmail.com", "bugtrack_url": null, "classifiers": [ "License :: OSI Approved :: Apache Software License", "Natural Language :: English", "Operating System :: OS Independent", "Programming Language :: Python", "Programming Language :: Python :: 3.6", "Programming Language :: Python :: 3.7" ], "description": ".. image:: https://img.shields.io/badge/stdlib--only-yes-green.svg\n :target: https://img.shields.io/badge/stdlib--only-yes-green.svg\n\n.. image:: https://travis-ci.org/cjrh/aiodec.svg?branch=master\n :target: https://travis-ci.org/cjrh/aiodec\n\n.. image:: https://coveralls.io/repos/github/cjrh/aiodec/badge.svg?branch=master\n :target: https://coveralls.io/github/cjrh/aiodec?branch=master\n\n.. image:: https://img.shields.io/pypi/pyversions/aiodec.svg\n :target: https://pypi.python.org/pypi/aiodec\n\n.. image:: https://img.shields.io/github/tag/cjrh/aiodec.svg\n :target: https://img.shields.io/github/tag/cjrh/aiodec.svg\n\n.. image:: https://img.shields.io/badge/install-pip%20install%20aiodec-ff69b4.svg\n :target: https://img.shields.io/badge/install-pip%20install%20aiodec-ff69b4.svg\n\n.. image:: https://img.shields.io/pypi/v/aiodec.svg\n :target: https://img.shields.io/pypi/v/aiodec.svg\n\n.. image:: https://img.shields.io/badge/calver-YYYY.MM.MINOR-22bfda.svg\n :target: http://calver.org/\n\naiodec\n======\n\n*Decorators for asyncio*\n\n.. contents::\n\nastopwatch\n----------\n\nThe ``astopwatch`` decorator is used in the following way:\n\n.. code-block:: python\n\n from aiodec import astopwatch\n\n @astopwatch\n async def blah(x, y):\n return x + y\n\nWhat does it do? This simple decorator will emit logs with the following message::\n\n INFO:aiodec:Time taken: 0.0003 seconds\n\n\nNot terribly special. Yet. You can also customize the log message:\n\n.. code-block:: python\n\n from aiodec import astopwatch\n\n @astopwatch(message_template='Time cost was $time_ sec', fmt='%.1g')\n async def blah(x, y):\n return x + y\n\nThis outputs log messages with the following message::\n\n INFO:aiodec:Time cost was 3e-4 sec\n\n\nTwo things: first, the template parameter used for the time cost is called\n``$time_``; second, you can customize the formatting of the seconds value.\nHowever, it can also do something a lot more interesting: it can include\nparameters from the wrapped function in the message:\n\n.. code-block:: python\n\n from aiodec import astopwatch\n\n @astopwatch(message_template='x=$x y=$y | $time_ seconds')\n async def blah(x, y=2):\n return x + y\n\n\n loop.run_until_complete(blah(1))\n\nThis outputs log messages with the following message::\n\n INFO:aiodec:x=1 y=2 | 0.0003 seconds\n\n\nMagic! Note that positional args and keyword args and default values\nare all handled correctly.\n\nAs you saw earlier, in addition to the function parameters, the special\n``$time_`` parameter will also be available. The other extra fields are:\n\n- ``$name_``, which contains the ``__name__`` of the wrapped function, and\n- ``$qualname_``, which contains the ``__qualname__`` of the wrapped function.\n\nThese three template parameters have a trailing underscore, to avoid collisions\nwith any parameter names.\n", "description_content_type": "text/x-rst", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/cjrh/aiodec", "keywords": "", "license": "", "maintainer": "", "maintainer_email": "", "name": "aiodec", "package_url": "https://pypi.org/project/aiodec/", "platform": "", "project_url": "https://pypi.org/project/aiodec/", "project_urls": { "Homepage": "https://github.com/cjrh/aiodec" }, "release_url": "https://pypi.org/project/aiodec/2018.10.1/", "requires_dist": [ "pytest; extra == \"dev\"", "pytest-cov; extra == \"dev\"", "wheel; extra == \"dev\"", "coveralls; extra == \"dev\"" ], "requires_python": "", "summary": "aiodec", "version": "2018.10.1" }, "last_serial": 4393757, "releases": { "2018.10.1": [ { "comment_text": "", "digests": { "md5": "a63ba0f828635ec7e41b6adb8f3a34bd", "sha256": "422a34ca9dfc7de6642e1b67ffd9f44ad60a1500d7d9991afe3bc0405e4ab8e3" }, "downloads": -1, "filename": "aiodec-2018.10.1-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "a63ba0f828635ec7e41b6adb8f3a34bd", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 16146, "upload_time": "2018-10-19T10:54:23", "url": "https://files.pythonhosted.org/packages/e7/7d/85c0f82552bc49c1976ded0edf49afa77043e6d3bf07b5eb4d27ad186770/aiodec-2018.10.1-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "a7663dc6b242a823db920e58ccbda497", "sha256": "33f098a78aaa7afda421f250d69f75258828e8c6694a7434082b93da60e3ffb8" }, "downloads": -1, "filename": "aiodec-2018.10.1.tar.gz", "has_sig": false, "md5_digest": "a7663dc6b242a823db920e58ccbda497", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 8294, "upload_time": "2018-10-19T10:54:33", "url": "https://files.pythonhosted.org/packages/52/24/069f91cbff71eb5742698afb484b363cdf00e56923d8964a4051bd1985a0/aiodec-2018.10.1.tar.gz" } ], "2018.3.1": [ { "comment_text": "", "digests": { "md5": "119187d2bba6cb141a66ac27e1c0af2c", "sha256": "ccdec7e9541cf82118daf181d31b4480074c0936342bb82abf55c05a48ca0a1a" }, "downloads": -1, "filename": "aiodec-2018.3.1-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "119187d2bba6cb141a66ac27e1c0af2c", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 15986, "upload_time": "2018-03-10T10:38:11", "url": "https://files.pythonhosted.org/packages/61/69/d1c87fcfcb671d379c9152de26ef1a88030bea59c7a9dd2a151480158815/aiodec-2018.3.1-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "d8e7a1fd8efba65bab5e6718359cc364", "sha256": "04be3d2df65c32a7abe070f3ab90e288616abd75f306ccac42d0ef3634557e56" }, "downloads": -1, "filename": "aiodec-2018.3.1.tar.gz", "has_sig": false, "md5_digest": "d8e7a1fd8efba65bab5e6718359cc364", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 8285, "upload_time": "2018-03-10T10:38:18", "url": "https://files.pythonhosted.org/packages/53/47/daca0e9f92f3e5f0710a848ea130af7078ac587ad4ba8ba74d273349c51a/aiodec-2018.3.1.tar.gz" } ], "2018.7.1": [ { "comment_text": "", "digests": { "md5": "d99440bbe5589fce9823f59cd8af0a76", "sha256": "0c61c90e98f93384ade391d8fb7fc1052ce81fa192c384089ffda041da78d461" }, "downloads": -1, "filename": "aiodec-2018.7.1-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "d99440bbe5589fce9823f59cd8af0a76", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 16009, "upload_time": "2018-07-12T11:45:44", "url": "https://files.pythonhosted.org/packages/a7/42/4bf02aaea332cfe59ba621becce3bdcd8ebe0c07c576186f57b5092e02f5/aiodec-2018.7.1-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "0e918cd767c1fcd57da742f0c5e12c9f", "sha256": "e1c6a0967f93357fd843e6eeae28bf5def4a116a2c60b9abe77084efb448099c" }, "downloads": -1, "filename": "aiodec-2018.7.1.tar.gz", "has_sig": false, "md5_digest": "0e918cd767c1fcd57da742f0c5e12c9f", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 8211, "upload_time": "2018-07-12T11:46:04", "url": "https://files.pythonhosted.org/packages/a1/8c/6dcdc0ca64c7dc825d8f7e67e35d6e78b1eb79583e4641a0ebb856c0cb34/aiodec-2018.7.1.tar.gz" } ], "2018.8.1": [ { "comment_text": "", "digests": { "md5": "ee32bf301390331be751cb204e54a93f", "sha256": "63283768d4222c542c87a87b22c1f54d8011c3abb4a082d14e1f406857c6326b" }, "downloads": -1, "filename": "aiodec-2018.8.1-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "ee32bf301390331be751cb204e54a93f", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 16006, "upload_time": "2018-08-08T04:05:33", "url": "https://files.pythonhosted.org/packages/80/71/5511d69374d0dac48d0f9cd5733fc18c50cc9bda786d627b2a2ec1d54252/aiodec-2018.8.1-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "f79b57b0a4ef5500309eec3388333bbe", "sha256": "788d7f7128df6532dd1b3b98825d15b55f0b36299398555a6530dc0c7b61c964" }, "downloads": -1, "filename": "aiodec-2018.8.1.tar.gz", "has_sig": false, "md5_digest": "f79b57b0a4ef5500309eec3388333bbe", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 8323, "upload_time": "2018-08-08T04:05:35", "url": "https://files.pythonhosted.org/packages/af/6e/f45af0d8f2a5e292cff7f1830082544b1daf7615ad04dfb53dd845774065/aiodec-2018.8.1.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "a63ba0f828635ec7e41b6adb8f3a34bd", "sha256": "422a34ca9dfc7de6642e1b67ffd9f44ad60a1500d7d9991afe3bc0405e4ab8e3" }, "downloads": -1, "filename": "aiodec-2018.10.1-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "a63ba0f828635ec7e41b6adb8f3a34bd", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 16146, "upload_time": "2018-10-19T10:54:23", "url": "https://files.pythonhosted.org/packages/e7/7d/85c0f82552bc49c1976ded0edf49afa77043e6d3bf07b5eb4d27ad186770/aiodec-2018.10.1-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "a7663dc6b242a823db920e58ccbda497", "sha256": "33f098a78aaa7afda421f250d69f75258828e8c6694a7434082b93da60e3ffb8" }, "downloads": -1, "filename": "aiodec-2018.10.1.tar.gz", "has_sig": false, "md5_digest": "a7663dc6b242a823db920e58ccbda497", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 8294, "upload_time": "2018-10-19T10:54:33", "url": "https://files.pythonhosted.org/packages/52/24/069f91cbff71eb5742698afb484b363cdf00e56923d8964a4051bd1985a0/aiodec-2018.10.1.tar.gz" } ] }