{ "info": { "author": "Andrew Nystrom", "author_email": "AWNystrom@gmail.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 4 - Beta", "Intended Audience :: Developers", "License :: OSI Approved :: Apache Software License", "Operating System :: OS Independent", "Programming Language :: Python", "Programming Language :: Python :: 2", "Programming Language :: Python :: 2.7" ], "description": "lru_cacher\r\n=========\r\n\r\nThis is a Least Recently Used (LRU) Cache implementation in Python.\r\n\r\nINSTALLATION\r\n\r\nTo install, simply run\r\npython setup.py install\r\n\r\nTo run unit tests, run\r\npython setup.py test\r\n\r\n\r\nEXAMPLE USAGE\r\n\r\n>>> from time import sleep\r\n>>>\r\n>>> from lru_cacher import LruCacher\r\n>>>\r\n>>> def slowSqrt(n):\r\n>>> sleep(2)\r\n>>> return n**0.5\r\n>>>\r\n>>> cache = LruCache(max_size=200, plan_b_func=slowSqrt)\r\n>>> #This lookup will be slow\r\n>>> answer, found_in_cache = cache.lookup(49)\r\n>>> print answer, found_in_cache\r\n7.0 False\r\n>>>\r\n>>> #This lookup will be fast\r\n>>> answer, found_in_cache = cache.lookup(49)\r\n>>> print answer, found_in_cache\r\n7.0 True\r\n>>>\r\n>>> #Let's modify the cache\r\n>>> cache.update(49, 'seven')\r\n>>> answer, found_in_cache = cache.lookup(49)\r\n>>> print answer, found_in_cache\r\nseven True", "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/AWNystrom/lru_cache", "keywords": "lru,cache,least,recently,used", "license": "Apache 2.0", "maintainer": "", "maintainer_email": "", "name": "lru_cacher", "package_url": "https://pypi.org/project/lru_cacher/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/lru_cacher/", "project_urls": { "Download": "UNKNOWN", "Homepage": "https://github.com/AWNystrom/lru_cache" }, "release_url": "https://pypi.org/project/lru_cacher/1.0.0/", "requires_dist": null, "requires_python": null, "summary": "Least Recently used Cache (LRU Cache) in Python", "version": "1.0.0" }, "last_serial": 1160923, "releases": { "1.0.0": [ { "comment_text": "", "digests": { "md5": "c40d32639591d8951b7015b617f0c6a3", "sha256": "b7a6fd2cb8b6227574b72f0d28e395c66864a3a24a69dec2d47731f321a43403" }, "downloads": -1, "filename": "lru_cacher-1.0.0.macosx-10.5-x86_64.exe", "has_sig": false, "md5_digest": "c40d32639591d8951b7015b617f0c6a3", "packagetype": "bdist_wininst", "python_version": "any", "requires_python": null, "size": 66981, "upload_time": "2014-07-14T03:11:57", "url": "https://files.pythonhosted.org/packages/1b/f8/3afca71abc11892bc9972c6714c153bf1b4a4bafbc352e072c7d6a1a24c7/lru_cacher-1.0.0.macosx-10.5-x86_64.exe" }, { "comment_text": "", "digests": { "md5": "90db0315ca6d1adb9fb2c2e54064c158", "sha256": "ffbd9ef559e79838472824db5226ef3fd68eb79eb5d506a349cbaaab189a74f2" }, "downloads": -1, "filename": "lru_cacher-1.0.0.tar.gz", "has_sig": false, "md5_digest": "90db0315ca6d1adb9fb2c2e54064c158", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 2483, "upload_time": "2014-07-14T03:11:54", "url": "https://files.pythonhosted.org/packages/70/33/3ef83a8d5343635864f82b3a9d36618681925686189b85e2f2a27a7d5cfd/lru_cacher-1.0.0.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "c40d32639591d8951b7015b617f0c6a3", "sha256": "b7a6fd2cb8b6227574b72f0d28e395c66864a3a24a69dec2d47731f321a43403" }, "downloads": -1, "filename": "lru_cacher-1.0.0.macosx-10.5-x86_64.exe", "has_sig": false, "md5_digest": "c40d32639591d8951b7015b617f0c6a3", "packagetype": "bdist_wininst", "python_version": "any", "requires_python": null, "size": 66981, "upload_time": "2014-07-14T03:11:57", "url": "https://files.pythonhosted.org/packages/1b/f8/3afca71abc11892bc9972c6714c153bf1b4a4bafbc352e072c7d6a1a24c7/lru_cacher-1.0.0.macosx-10.5-x86_64.exe" }, { "comment_text": "", "digests": { "md5": "90db0315ca6d1adb9fb2c2e54064c158", "sha256": "ffbd9ef559e79838472824db5226ef3fd68eb79eb5d506a349cbaaab189a74f2" }, "downloads": -1, "filename": "lru_cacher-1.0.0.tar.gz", "has_sig": false, "md5_digest": "90db0315ca6d1adb9fb2c2e54064c158", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 2483, "upload_time": "2014-07-14T03:11:54", "url": "https://files.pythonhosted.org/packages/70/33/3ef83a8d5343635864f82b3a9d36618681925686189b85e2f2a27a7d5cfd/lru_cacher-1.0.0.tar.gz" } ] }