{ "info": { "author": "Ga\u00c3\u00abl Le Mignot", "author_email": "gael@pilotsystems.net", "bugtrack_url": null, "classifiers": [ "Development Status :: 5 - Production/Stable", "Intended Audience :: Developers", "License :: OSI Approved :: GNU General Public License (GPL)", "Operating System :: OS Independent", "Programming Language :: Python", "Topic :: Software Development :: Libraries", "Topic :: Software Development :: Libraries :: Python Modules" ], "description": "This simple generic cache implementation is Copyright(c) Pilot\r\nSystems, 2006-2008 and available under the terms of the GNU GPL v2.\r\n\r\nVersion information\r\n-------------------\r\n\r\nVersion 1.0.2, requires Python 2.4 or higher.\r\n\r\nFeatures\r\n--------\r\n\r\n- fast in memory caching of any object\r\n\r\n- transparent dictionnary-like usage\r\n\r\n- possibility to limit the cache size in number of objects\r\n\r\n- possibility to expire automatically objects after a given time of no update\r\n\r\n- thread-safe\r\n\r\nBasic usage\r\n-----------\r\n\r\nCreating a cache:\r\n\r\n >>> from GenericCache.GenericCache import GenericCache\r\n >>> c = GenericCache()\r\n\r\nStoring values:\r\n\r\n >>> c[\"key\"] = \"value\"\r\n or\r\n >>> c.insert(\"key\", \"value\")\r\n\r\nRetrieving values:\r\n\r\n >>> c[\"key\"]\r\n or\r\n >>> c.fetch(\"key\")\r\n\r\nNone is returned if no value is found in the cache. Fetch can take\r\nan optional value to fail with KeyError if no value is found.\r\n\r\n\r\nWarnings\r\n--------\r\n\r\n- in current implementation keys are converted into strings\r\n\r\n- object expiry for timeout is lazy, which means that objects stay in\r\n the cache until someone try to access them, len() will still see\r\n them; there is a collect() method to collect all timeouted objects,\r\n but it may be slow.\r\n\r\nDecorator usage\r\n---------------\r\n\r\nThe decorator, for Python 2.4+, can be used to decorate any function\r\nor method. Here is an example:\r\n\r\n >>> from GenericCache.GenericCache import GenericCache\r\n >>> from GenericCache.decorators import cached\r\n >>> cache = GenericCache()\r\n >>> @cached(cache)\r\n ... def add(x, y):\r\n ... print x, \"+\", y\r\n ... return x + y\r\n ... \r\n >>> add(2,3)\r\n 2 + 3\r\n 5\r\n >>> add(2,3)\r\n 5\r\n >>> add(2,4)\r\n 2 + 4\r\n 6\r\n >>> add(2,4)\r\n 6\r\n >>> add(2,3)\r\n 5\r\n >>> \r\n \r\nThe decorator takes an optional parameter, a marshaller that filter\r\nthe paramters of the function and converts it into a caching key (some\r\nparameters may be discarded, for example).", "description_content_type": null, "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "UNKNOWN", "keywords": "", "license": "GPL", "maintainer": "", "maintainer_email": "", "name": "GenericCache", "package_url": "https://pypi.org/project/GenericCache/", "platform": "Linux", "project_url": "https://pypi.org/project/GenericCache/", "project_urls": { "Homepage": "UNKNOWN" }, "release_url": "https://pypi.org/project/GenericCache/1.0.2/", "requires_dist": null, "requires_python": null, "summary": "A generic memory-cache module", "version": "1.0.2" }, "last_serial": 784416, "releases": { "1.0": [ { "comment_text": "Module for Python 2.4 or higher", "digests": { "md5": "4d5a08a0585c7ccf04f0221ad9dbdceb", "sha256": "0fb5a39a6f8c1889616105534e0a31706c3da6c8809ced54ec3d56682532553a" }, "downloads": -1, "filename": "GenericCache-1.0.tar.gz", "has_sig": false, "md5_digest": "4d5a08a0585c7ccf04f0221ad9dbdceb", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 11499, "upload_time": "2007-10-18T12:06:13", "url": "https://files.pythonhosted.org/packages/91/1e/f0578dc3176e534b167e63e46dfd62cae5a34dfb9f40b2d4ee9b58c88973/GenericCache-1.0.tar.gz" } ], "1.0.1": [ { "comment_text": "", "digests": { "md5": "e43910fe17d859d4edaa041511a1862a", "sha256": "f48a870a52d1b98e122056b57f265df34bd02c527dfc17a61ce5e74970d28dd3" }, "downloads": -1, "filename": "GenericCache-1.0.1.tar.gz", "has_sig": false, "md5_digest": "e43910fe17d859d4edaa041511a1862a", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 11833, "upload_time": "2008-08-28T09:04:51", "url": "https://files.pythonhosted.org/packages/be/71/9dd239d7a8afe28881b37bee0c5c85f92b094a78cc2e18a3922aa0ec3543/GenericCache-1.0.1.tar.gz" } ], "1.0.2": [ { "comment_text": "", "digests": { "md5": "d5fac0e8c21209240c9086d16460c6ad", "sha256": "40bab49a96bba1b020d0b79e649c932d9924c0afe9c3426a5ae9a5f5bfa23878" }, "downloads": -1, "filename": "GenericCache-1.0.2.tar.gz", "has_sig": false, "md5_digest": "d5fac0e8c21209240c9086d16460c6ad", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 12243, "upload_time": "2009-11-18T18:18:06", "url": "https://files.pythonhosted.org/packages/e3/49/1eba17500ceaa7a9cfea7986edbc5d08aec0b48c7ed7a6bacd584615e68d/GenericCache-1.0.2.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "d5fac0e8c21209240c9086d16460c6ad", "sha256": "40bab49a96bba1b020d0b79e649c932d9924c0afe9c3426a5ae9a5f5bfa23878" }, "downloads": -1, "filename": "GenericCache-1.0.2.tar.gz", "has_sig": false, "md5_digest": "d5fac0e8c21209240c9086d16460c6ad", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 12243, "upload_time": "2009-11-18T18:18:06", "url": "https://files.pythonhosted.org/packages/e3/49/1eba17500ceaa7a9cfea7986edbc5d08aec0b48c7ed7a6bacd584615e68d/GenericCache-1.0.2.tar.gz" } ] }