{ "info": { "author": "Vichaya Sirisanthana", "author_email": "vsirisanthana@gmail.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 3 - Alpha", "Intended Audience :: Developers", "License :: OSI Approved :: GNU General Public License (GPL)", "Programming Language :: Python", "Topic :: Software Development :: Libraries :: Python Modules" ], "description": "====================\r\nINSTALLATION\r\n====================\r\n>>> pip install dummycache\r\n\r\n====================\r\nUSAGE\r\n====================\r\n>>> from dummycache import Cache\r\n>>> c = Cache()\r\n\r\nThe basic interface is ``set(key, value, timeout=None)`` and ``get(key, default=None)``:\r\n\r\n>>> c.set('key_a', 'Good morning, today!', 60) # Set value in cache for 60 seconds\r\n>>> c.get('key_a')\r\n'Good morning, today!'\r\n\r\nWait 60 seconds:\r\n\r\n>>> c.get('key_a')\r\nNone\r\n\r\nIf ``timeout`` is not provided, the value is saved forever or until it is overridden or explicitly deleted:\r\n\r\n>>> c.set('key_b', 'Good afternoon, forever!') # Set value in cache forever\r\n\r\nIf ``timeout`` is zero or negative, the value is not saved. The value previously saved with the same key will also be\r\ndeleted:\r\n\r\n>>> c.set('key_b', 'Good bye', 0) # The value is not set\r\n>>> c.get('key_b')\r\nNone\r\n\r\n``cache.get()`` can take a default argument. This specifies which value to return if the object doesn't exist in the\r\ncache:\r\n\r\n>>> c.get('key_a', 'has expired')\r\n'has expired'\r\n\r\nTo add a key only if it doesn't already exist, use the ``add()`` method. It takes the same parameters as ``set()``, but\r\nit will not attempt to update the cache if the key specified is already present:\r\n\r\n>>> c.set('key_c', 'Initial value')\r\n>>> c.add('key_c', 'New value')\r\n>>> c.get('key_c')\r\n'Initial value'\r\n\r\nIf you need to know whether ``add()`` stored a value in the cache, you can check the return value. It will return\r\n``True`` if the value was stored, ``False`` otherwise.\r\n\r\nYou can delete keys explicitly with ``delete()``. This is an easy way of clearing the cache for a particular object:\r\n\r\n>>> c.delete('key_c')\r\n\r\nFinally, if you want to delete all the keys in the cache, use ``clear()``. Be careful with this; ``clear()`` will remove\r\n everything from the cache, not just the keys set by your application.\r\n\r\n>>> c.clear()", "description_content_type": null, "docs_url": null, "download_url": "http://pypi.python.org/pypi/dummycache", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "http://code.google.com/p/dummycache/", "keywords": "cache python", "license": "GPL-3.0", "maintainer": "", "maintainer_email": "", "name": "dummycache", "package_url": "https://pypi.org/project/dummycache/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/dummycache/", "project_urls": { "Download": "http://pypi.python.org/pypi/dummycache", "Homepage": "http://code.google.com/p/dummycache/" }, "release_url": "https://pypi.org/project/dummycache/0.0.2/", "requires_dist": null, "requires_python": null, "summary": "A dummy in-memory cache for development and testing. (Not recommended for production use.)", "version": "0.0.2" }, "last_serial": 791436, "releases": { "0.0.1": [ { "comment_text": "", "digests": { "md5": "d225532fc90818bd18f459ba5a47864f", "sha256": "db4dc3d30fa106d6a035f6189a6bbe05ad116c512e53549695c4c36e871c667b" }, "downloads": -1, "filename": "dummycache-0.0.1.tar.gz", "has_sig": false, "md5_digest": "d225532fc90818bd18f459ba5a47864f", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 2910, "upload_time": "2012-03-19T13:48:03", "url": "https://files.pythonhosted.org/packages/bd/ce/371ba134d7169093b0847e99e5731e7a36f7830b63706e5da1108a3586dc/dummycache-0.0.1.tar.gz" } ], "0.0.2": [ { "comment_text": "", "digests": { "md5": "04fa9ac02190ac788b59f2fc38af89c4", "sha256": "7351c19fc84c16154ca7b0dcdc479c9d22b7893685287aa4993f6cc1878a2207" }, "downloads": -1, "filename": "dummycache-0.0.2.tar.gz", "has_sig": false, "md5_digest": "04fa9ac02190ac788b59f2fc38af89c4", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3790, "upload_time": "2012-04-08T20:36:22", "url": "https://files.pythonhosted.org/packages/e2/1b/5420ba197f15d139520901bb03ef8be3be7030ea2fdd1990f229a2991e0b/dummycache-0.0.2.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "04fa9ac02190ac788b59f2fc38af89c4", "sha256": "7351c19fc84c16154ca7b0dcdc479c9d22b7893685287aa4993f6cc1878a2207" }, "downloads": -1, "filename": "dummycache-0.0.2.tar.gz", "has_sig": false, "md5_digest": "04fa9ac02190ac788b59f2fc38af89c4", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3790, "upload_time": "2012-04-08T20:36:22", "url": "https://files.pythonhosted.org/packages/e2/1b/5420ba197f15d139520901bb03ef8be3be7030ea2fdd1990f229a2991e0b/dummycache-0.0.2.tar.gz" } ] }