{ "info": { "author": "Cedric Zhuang", "author_email": "jealous@163.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 4 - Beta", "Intended Audience :: Developers", "License :: OSI Approved :: Apache Software License", "Natural Language :: English", "Operating System :: OS Independent", "Programming Language :: Python", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3.4", "Programming Language :: Python :: 3.5", "Programming Language :: Python :: Implementation :: CPython", "Programming Language :: Python :: Implementation :: PyPy", "Topic :: Utilities" ], "description": "Cache Decorator\n===============\n\n.. image:: https://travis-ci.org/jealous/cachez.svg\n :target: https://travis-ci.org/jealous/cachez\n \n.. image:: https://coveralls.io/repos/jealous/cachez/badge.svg\n :target: https://coveralls.io/github/jealous/cachez\n\n.. image:: https://img.shields.io/pypi/v/cachez.svg\n :target: https://pypi.python.org/pypi/cachez\n\n\nVERSION: 0.1.2\n\nIntroduction\n------------\n\nFunction decorator that helps to cache/memoize the result of a function/method.\n\nThis package contains following decorators.\n\n- cache: cache the result of the function globally.\n- instance_cache: cache the result of a method in the instance (``self``)\n- clear_instance_cache: clear the method results cached on the instance.\n\nAnd one function.\n\n- clear_cache: clear the global function cache.\n\nTested on python 2.7 and python 3.4.\n\nFor quick start, check the tutorial section of this page.\nCheck `cachez_test.py`_ for detail examples.\n\nInstallation\n------------\n\n``pip install cachez``\n\n\nLicense\n-------\n\n`Apache License version 2`_\n\nTutorial\n--------\n\n- To cache the result of the a function globally, decorate the function\n with ``cache``.\n\n.. code-block:: python\n\n @cache\n def foo(x, y):\n ...\n\n\n- To clear the global cache, call ``clear_cache()``.\n\n.. code-block:: python\n\n clear_cache()\n\n\n- To cache the result of the method in the instance, decorate the method\n with ``instance_cache``.\n To clear the method cache on the instance, decorate your clear method\n with ``clear_instance_cache``.\n\n.. code-block:: python\n\n class Foo(object):\n @instance_cache\n def bar(a, b):\n ...\n\n @clear_instance_cache\n def clear():\n ...\n\n\n- To persist the function return value, use ``persisted`` decorator.\n This decorator takes input parameter which specify when the cache\n will expire. The default value for cache expiration is set to 1 day.\n\n.. code-block:: python\n\n class Foo(object):\n @persisted()\n def default_persist_for_1_day(x):\n ...\n\n @persisted(seconds=5)\n def persist_return_value_for_5_seconds(y):\n ...\n\n\n- The default persist folder is set to ``~/.cachez``. You could customize\n it by calling ``set_persist_folder``.\n\n\nTo file issue, please visit:\n\nhttps://github.com/jealous/cachez\n\n\nContact author:\n\n- Cedric Zhuang \n\nContributors:\n\n- Ryan Liang \n\n.. _Apache License version 2: LICENSE.txt\n.. _cachez_test.py: cachez_test.py\n", "description_content_type": null, "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "http://github.com/jealous/cachez", "keywords": "cache decorator", "license": "Apache Software License", "maintainer": "", "maintainer_email": "", "name": "cachez", "package_url": "https://pypi.org/project/cachez/", "platform": "any", "project_url": "https://pypi.org/project/cachez/", "project_urls": { "Homepage": "http://github.com/jealous/cachez" }, "release_url": "https://pypi.org/project/cachez/0.1.2/", "requires_dist": null, "requires_python": "", "summary": "Cache decorator for global or instance level memoize.", "version": "0.1.2" }, "last_serial": 2877496, "releases": { "0.1.0": [ { "comment_text": "", "digests": { "md5": "c3be2add28dc7c9810789bf023de053a", "sha256": "98c8ae3af30963f39dd1f51a5a2a81866a9aa02051a3b4292f28cc428addbc8d" }, "downloads": -1, "filename": "cachez-0.1.0-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "c3be2add28dc7c9810789bf023de053a", "packagetype": "bdist_wheel", "python_version": "2.7", "requires_python": null, "size": 6318, "upload_time": "2016-05-27T10:09:58", "url": "https://files.pythonhosted.org/packages/32/bd/d84c4cad7fdb0ae265c4249f80a6c5d7a776d83e4abc6cd77684eb7ddc15/cachez-0.1.0-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "caa5108ffcd9194cf69a315d5c44bbaa", "sha256": "43016507200ce6361edb4256339f4e17ce09693f42a3944eb34460651507766f" }, "downloads": -1, "filename": "cachez-0.1.0.zip", "has_sig": false, "md5_digest": "caa5108ffcd9194cf69a315d5c44bbaa", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 12531, "upload_time": "2017-02-01T12:27:21", "url": "https://files.pythonhosted.org/packages/2d/84/58be622dfe626e722da1f99b0c7143020799c5662ccfe5a38483a5073d5c/cachez-0.1.0.zip" } ], "0.1.1": [ { "comment_text": "", "digests": { "md5": "f2572f6b22bc5d19c816795081890b2b", "sha256": "7577673c1bb781ddb631430b12e1a5a998f660faa5df6ad04d02ee6dd21df30a" }, "downloads": -1, "filename": "cachez-0.1.1-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "f2572f6b22bc5d19c816795081890b2b", "packagetype": "bdist_wheel", "python_version": "2.7", "requires_python": null, "size": 7984, "upload_time": "2017-02-07T03:43:06", "url": "https://files.pythonhosted.org/packages/60/d9/3bd41eec3c0abec55db8b5c5894d8154fdd851ce9164bf8b93a97c83c465/cachez-0.1.1-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "4c3616ad285781f4d97a4e3323d6770d", "sha256": "7cc6350cd0beb2b6100815a63f5ba23429ec1f579f29d9e0a3efc751336cb6ee" }, "downloads": -1, "filename": "cachez-0.1.1.zip", "has_sig": false, "md5_digest": "4c3616ad285781f4d97a4e3323d6770d", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 14197, "upload_time": "2017-02-07T03:43:01", "url": "https://files.pythonhosted.org/packages/bd/ed/293f193ed33ba5cf3c1a89069cc80d97b548de2f8745602c4bc74f0e53b9/cachez-0.1.1.zip" } ], "0.1.2": [ { "comment_text": "", "digests": { "md5": "65be88b0091046b6cefefe9b4e2bd9c7", "sha256": "0322d0032d6ed02b83b64a947ee10c7848e98261af5f9d7846a89e6abdc49b22" }, "downloads": -1, "filename": "cachez-0.1.2-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "65be88b0091046b6cefefe9b4e2bd9c7", "packagetype": "bdist_wheel", "python_version": "3.6", "requires_python": null, "size": 8377, "upload_time": "2017-05-16T07:51:10", "url": "https://files.pythonhosted.org/packages/4c/e7/3ebd5990d7d2140a138f70ce2ff5bfdc9f813ba545fbd0cd9a6857940784/cachez-0.1.2-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "fd097c80ff73d17fbe47b91d00c21ddd", "sha256": "3ebc0b052d56755902b8068a4ed0d642325f96b0070862288abaad77c9d3c282" }, "downloads": -1, "filename": "cachez-0.1.2.tar.gz", "has_sig": false, "md5_digest": "fd097c80ff73d17fbe47b91d00c21ddd", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 11214, "upload_time": "2017-05-16T07:51:07", "url": "https://files.pythonhosted.org/packages/c5/3e/67c7ce94d258cf0070f62aed6ef705ce83314e7e72eb40d881b5cc90642a/cachez-0.1.2.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "65be88b0091046b6cefefe9b4e2bd9c7", "sha256": "0322d0032d6ed02b83b64a947ee10c7848e98261af5f9d7846a89e6abdc49b22" }, "downloads": -1, "filename": "cachez-0.1.2-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "65be88b0091046b6cefefe9b4e2bd9c7", "packagetype": "bdist_wheel", "python_version": "3.6", "requires_python": null, "size": 8377, "upload_time": "2017-05-16T07:51:10", "url": "https://files.pythonhosted.org/packages/4c/e7/3ebd5990d7d2140a138f70ce2ff5bfdc9f813ba545fbd0cd9a6857940784/cachez-0.1.2-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "fd097c80ff73d17fbe47b91d00c21ddd", "sha256": "3ebc0b052d56755902b8068a4ed0d642325f96b0070862288abaad77c9d3c282" }, "downloads": -1, "filename": "cachez-0.1.2.tar.gz", "has_sig": false, "md5_digest": "fd097c80ff73d17fbe47b91d00c21ddd", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 11214, "upload_time": "2017-05-16T07:51:07", "url": "https://files.pythonhosted.org/packages/c5/3e/67c7ce94d258cf0070f62aed6ef705ce83314e7e72eb40d881b5cc90642a/cachez-0.1.2.tar.gz" } ] }