{ "info": { "author": "jiangtao", "author_email": "jiangtao.work@gmail.com", "bugtrack_url": null, "classifiers": [ "Intended Audience :: Developers", "License :: OSI Approved :: Apache Software License", "Operating System :: OS Independent", "Programming Language :: Python :: 2.7" ], "description": "# do_utils\nUtils write for common usage.\n\n## do_time\n\nFunc timer - count func time with decorator\n\n- Usage:\n\n```python\nfrom do_utils import do_time\n\n@do_time()\ndef do_print():\n print len([x for x in xrange(10000)])\n\nclass A(object):\n @do_time(func=False)\n def do_print(self):\n print len([x for x in xrange(10000)])\n```\n\n## do_cache\n\nDo cache for GET request url handler in Tornado server\n\n```text\ndo_cache:\n do cahche for request with uri & user & params\n cache_key include (protocol, host_name, path, md5(current_user, params))\n cache_expire depend on kwargs expire, the default is 5*60s\n cache from write_buffer that have not flushed wrote by self.write() and will be flush\n if cache is none:\n get data & return data & do cache\n else:\n return cache\ndo_api_cache:\n do cache for api handler\n if status_code == 200:\n do_cache\ndo_temp_cache:\n do cache for template handler\n```\n\n- Usage:\n\n```python\nfrom do_utils import do_api_cache, do_temp_cache\n\nclass ApiHandler(object):\n @do_api_cache(10)\n def get(self):\n print 'get api'\n\n @do_temp_cache(10, with_user=False)\n def get(self):\n print 'get template'\n```\n\n## Change History\n\n- v0.0.1\n\n```text\ndo utils\ndo api/template cache for tornado server with redis\n```\n\n- v0.0.2\n\n```text\nbugfix for install_requires cannot using 'requirements.txt'\nadd prefix for cache_key: 'cache:'\n```\n\n- v0.0.3\n\n```text\nbugfix for Python3 and dependence\n```\n\n\n", "description_content_type": "text/markdown", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/hustjiangtao/do_utils", "keywords": "utils,do_utils,cache,time,do_cache,do_time", "license": "http://www.apache.org/licenses/LICENSE-2.0", "maintainer": "", "maintainer_email": "", "name": "do-utils", "package_url": "https://pypi.org/project/do-utils/", "platform": "", "project_url": "https://pypi.org/project/do-utils/", "project_urls": { "Homepage": "https://github.com/hustjiangtao/do_utils" }, "release_url": "https://pypi.org/project/do-utils/0.0.3/", "requires_dist": [ "ujson (==1.35)", "xlwt (<=2.0.0,>=1.3.0)", "openpyxl (<=3.0.0,>=2.6.2)" ], "requires_python": ">=2.7.14", "summary": "Utils for tornado api cache, function timer.", "version": "0.0.3" }, "last_serial": 5470253, "releases": { "0.0.1": [ { "comment_text": "", "digests": { "md5": "1b0d8cb67d373c0abafc7bbf3848b3f9", "sha256": "bacaa36b00f5f01a02ee2bac24e5a02ada3caa29fec9d30c6997fdeb18b70944" }, "downloads": -1, "filename": "do_utils-0.0.1-py3-none-any.whl", "has_sig": false, "md5_digest": "1b0d8cb67d373c0abafc7bbf3848b3f9", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 10875, "upload_time": "2019-07-01T09:16:21", "url": "https://files.pythonhosted.org/packages/6c/20/a66a10d8b532d21bde36be42b6429820bbb04ea01ae31ae76e35c75fe79b/do_utils-0.0.1-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "2c7ff34911d488d3c95b86d4140f2cbd", "sha256": "a3bec6d49bebe815e73049eaf05888182554316af5271fa624e05ed35a8219d7" }, "downloads": -1, "filename": "do-utils-0.0.1.tar.gz", "has_sig": false, "md5_digest": "2c7ff34911d488d3c95b86d4140f2cbd", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4245, "upload_time": "2018-09-18T10:38:52", "url": "https://files.pythonhosted.org/packages/55/c4/a52d5144e9007fa09647f7447d0f5749adba6441a5a0e241d5d57ec5ac4d/do-utils-0.0.1.tar.gz" } ], "0.0.2": [ { "comment_text": "", "digests": { "md5": "d6d202e9bc80fe1a92de57a19e68b1aa", "sha256": "933b0e759854fe2731aaf7f01f0694c5240cc595e563f7736605b30e9f6c8d44" }, "downloads": -1, "filename": "do-utils-0.0.2.tar.gz", "has_sig": false, "md5_digest": "d6d202e9bc80fe1a92de57a19e68b1aa", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5267, "upload_time": "2018-12-21T11:04:19", "url": "https://files.pythonhosted.org/packages/16/8c/d50a4b7d0140d17cffc1ffaef3fadbd279049d126a34b762e6042ea8efb3/do-utils-0.0.2.tar.gz" } ], "0.0.3": [ { "comment_text": "", "digests": { "md5": "7369bb7eba66898ef7a7ebab5d31e576", "sha256": "24f1090801bfc2c8c8cf7315412464d5ddb8e0bfcdd6b8966f9f85d01e7181da" }, "downloads": -1, "filename": "do_utils-0.0.3-py3-none-any.whl", "has_sig": false, "md5_digest": "7369bb7eba66898ef7a7ebab5d31e576", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=2.7.14", "size": 10862, "upload_time": "2019-07-01T09:18:44", "url": "https://files.pythonhosted.org/packages/f7/94/fa82c0a24124609896861c873c8768a710de2d24aa3c7ce6f5b52088c661/do_utils-0.0.3-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "922e29d042c5c318acb3f709d9e67dfc", "sha256": "0c0046b928ade005c1dfaf50159ef2958fc230f0b1757b5aa3d2974e060bc107" }, "downloads": -1, "filename": "do-utils-0.0.3.tar.gz", "has_sig": false, "md5_digest": "922e29d042c5c318acb3f709d9e67dfc", "packagetype": "sdist", "python_version": "source", "requires_python": ">=2.7.14", "size": 5516, "upload_time": "2019-07-01T09:18:46", "url": "https://files.pythonhosted.org/packages/27/d1/3632f1203700d4caef10fa155adf423a14a934939645ab914032b71cbad5/do-utils-0.0.3.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "7369bb7eba66898ef7a7ebab5d31e576", "sha256": "24f1090801bfc2c8c8cf7315412464d5ddb8e0bfcdd6b8966f9f85d01e7181da" }, "downloads": -1, "filename": "do_utils-0.0.3-py3-none-any.whl", "has_sig": false, "md5_digest": "7369bb7eba66898ef7a7ebab5d31e576", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=2.7.14", "size": 10862, "upload_time": "2019-07-01T09:18:44", "url": "https://files.pythonhosted.org/packages/f7/94/fa82c0a24124609896861c873c8768a710de2d24aa3c7ce6f5b52088c661/do_utils-0.0.3-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "922e29d042c5c318acb3f709d9e67dfc", "sha256": "0c0046b928ade005c1dfaf50159ef2958fc230f0b1757b5aa3d2974e060bc107" }, "downloads": -1, "filename": "do-utils-0.0.3.tar.gz", "has_sig": false, "md5_digest": "922e29d042c5c318acb3f709d9e67dfc", "packagetype": "sdist", "python_version": "source", "requires_python": ">=2.7.14", "size": 5516, "upload_time": "2019-07-01T09:18:46", "url": "https://files.pythonhosted.org/packages/27/d1/3632f1203700d4caef10fa155adf423a14a934939645ab914032b71cbad5/do-utils-0.0.3.tar.gz" } ] }