{ "info": { "author": "Amit Tripathi", "author_email": "mail2amit19@gmail.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 3 - Alpha" ], "description": "=======\r\nDeckor\r\n=======\r\n\r\nDecorate your functions and with 'deckor'ators. A module created while learning decorators.\r\n\r\nInstallation\r\n=============\r\n\r\n pip install deckor\r\n\r\n\r\nDecorators Supported:\r\n======================\r\n\r\n* timer : Measure execution time of functions\r\n\r\n @deckor.timer\r\n def fact(x):\r\n if x <= 0:\r\n return 1\r\n return x*fact(x-1)\r\n\r\n* cacheit : Cache intermediate results\r\n\r\n @deckor.cacheit\r\n def fact(x):\r\n if x <= 0:\r\n return 1\r\n return x*fact(x-1)\r\n\r\n* trace : Print the pretty recursion trace\r\n\r\n @deckor.trace\r\n def fib(x):\r\n if x < 2:\r\n return x\r\n return fib(x-1)+fib(x-2)\r\n\r\n fib(10)\r\n\r\n Now, try trace with cacheit\r\n\r\n @deckor.cacheit\r\n @deckor.trace\r\n def fib(x):\r\n if x < 2:\r\n return x\r\n return fib(x-1)+fib(x-2)\r\n\r\n fib(10)\r\n\r\n* with_retries : function signature: with_retries(tries=5, delay=0, increment=0). Try execution of function with retries. Retry'tries' no of times. Delay of 'delay' seconds between retries. Increase the delay by 'increment' between retries\r\n\r\n @with_retries(5)\r\n def random_f():\r\n try: r = requests.get(\"random\")\r\n except: return\r\n\r\n* syncronize : Provides very basic syncronization. Note: Not free from race condition only for basic usage\r\n\r\n import threading\r\n \r\n lock = threading.Lock()\r\n sample_list = []\r\n\r\n @deckor.syncronize(lock)\r\n def sample(sample_list):\r\n sample_list.append(1)\r\n\r\n #sample list is modified only after lock is acquired\r\n #so, mdification is sample_list os thread safe", "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/amitt001/deckor", "keywords": "", "license": "MIT", "maintainer": "", "maintainer_email": "", "name": "deckor", "package_url": "https://pypi.org/project/deckor/", "platform": "Linux: Ubuntu 14.04", "project_url": "https://pypi.org/project/deckor/", "project_urls": { "Download": "UNKNOWN", "Homepage": "https://github.com/amitt001/deckor" }, "release_url": "https://pypi.org/project/deckor/0.0.1/", "requires_dist": null, "requires_python": null, "summary": "A python module of useful decorators", "version": "0.0.1" }, "last_serial": 2154534, "releases": { "0.0.1": [ { "comment_text": "", "digests": { "md5": "71884cefc5b4c6c4e90bd201189c68fc", "sha256": "28b026c6e238c5315cbdc216492bb68a83d1809111daa967fad99030fb1574d9" }, "downloads": -1, "filename": "deckor-0.0.1.tar.gz", "has_sig": false, "md5_digest": "71884cefc5b4c6c4e90bd201189c68fc", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 2346, "upload_time": "2016-06-07T09:00:25", "url": "https://files.pythonhosted.org/packages/65/2d/6f2c6bc21795ee46579a786ffb79472a9041a3e74ffe9be30956a3a4fe5b/deckor-0.0.1.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "71884cefc5b4c6c4e90bd201189c68fc", "sha256": "28b026c6e238c5315cbdc216492bb68a83d1809111daa967fad99030fb1574d9" }, "downloads": -1, "filename": "deckor-0.0.1.tar.gz", "has_sig": false, "md5_digest": "71884cefc5b4c6c4e90bd201189c68fc", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 2346, "upload_time": "2016-06-07T09:00:25", "url": "https://files.pythonhosted.org/packages/65/2d/6f2c6bc21795ee46579a786ffb79472a9041a3e74ffe9be30956a3a4fe5b/deckor-0.0.1.tar.gz" } ] }