{
"info": {
"author": "Tomasz W\u00f3jcik",
"author_email": "tomek@bthlabs.pl",
"bugtrack_url": null,
"classifiers": [
"Development Status :: 4 - Beta",
"Intended Audience :: Developers",
"License :: OSI Approved :: BSD License",
"Operating System :: OS Independent",
"Programming Language :: Python",
"Topic :: Software Development :: Libraries :: Python Modules"
],
"description": "RedCache\n========\n\nRedCache is a lightweight and extensible caching framework for Python\napplications. It uses Redis as its storage backend.\n\nQuickstart\n----------\n\nSuppose we have a function that loads data from a remote source::\n\n def load_something_from_somewhere():\n # Load the data...\n return data\n\nNow let's use it in a Flask view::\n\n @app.route('/something/')\n def get_something():\n data = load_something_from_somewhere()\n # Do something with the data...\n return jsonify(data=data)\n\nThe problem here is that the view will wait until the data is fetched. If the\nview is called often it'll generate significant traffic between our server and\nthe remote source. This isn't pretty.\n\nWhat if we cached the loaded data for some time and refresh it only when the\ncache expires? That would be pretty.\n\nThere are many caching solutions, e.g.\n`Beaker `_. RedCache is similar to\n(and inspired by) Beaker but provides only one storage backend - Redis.\n\nSo, how do you cache *load_something_from_somewhere* using Redis and RedCache?\n\nFirst setup Redis connection before starting the app::\n\n from redcache import use_connection\n use_connection()\n\nThen make the function cached::\n\n from redcache import default_cache\n\n @default_cache.cache(ttl=5)\n def load_something_from_somewhere():\n # Load the data...\n return data\n\nNext time *load_something_from_somewhere* is called RedCache will try to load\nits last return value from Redis. If it's not found then the function will be\nexecuted and its return value stored in Redis for 5 seconds.\n\n``redcache.default_cache`` is an instance of\n``redcache.cache_manager.DefaultCacheManager`` which gives convenient\naccess to caching mechanism which uses cPickle behind\nthe scenes. By default the keys will be stored infinitely. Use *ttl* keyword\nargument in the decorator to define different TTL.\n\nExtending and advanced use\n--------------------------\n\nRedCache can be easily extended to utilize Redis' datatypes and features.\n\nBy overriding ``redcache.cache_manager.CacheManager.after_load`` and\n``redcache.cache_manager.CacheManager.before_save`` you can perform\nadditional operations on data. This way you can e.g. store JSON strings instead\nof pickled objects.\n\nBy overriding\n``redcache.cache_manager.CacheManager.load`` and\n``redcache.cache_manager.CacheManager.save`` you can change the way data\nis loaded and saved. This way you can e.g. store lists of individual objects\nand retrieve them according to pagination options.\n\nConsult examples to see how to integrate RedCache with SQLAlchemy and to see\nhow to use JSON instead of cPickle.\n\nAuthor, credits and license\n---------------------------\n\nRedCache is developed by `BTHLabs `_.\n\nRedCache is licensed under BSD License.\nSee `LICENSE `_\nfor more details.\n\nThis project uses Redis connection management code from\n`RQ `_.\n\nThis project uses context-local objects code from\n`Werkzeug `_.\n\nSource code\n-----------\n\nSource code is available from\n`project repository `_ on GitHub.",
"description_content_type": null,
"docs_url": null,
"download_url": "https://github.com/tomekwojcik/redcache/tarball/v0.3",
"downloads": {
"last_day": -1,
"last_month": -1,
"last_week": -1
},
"home_page": "http://tomekwojcik.github.io/redcache/",
"keywords": null,
"license": "https://github.com/tomekwojcik/redcache/blob/master/LICENSE",
"maintainer": null,
"maintainer_email": null,
"name": "RedCache",
"package_url": "https://pypi.org/project/RedCache/",
"platform": "any",
"project_url": "https://pypi.org/project/RedCache/",
"project_urls": {
"Download": "https://github.com/tomekwojcik/redcache/tarball/v0.3",
"Homepage": "http://tomekwojcik.github.io/redcache/"
},
"release_url": "https://pypi.org/project/RedCache/0.3/",
"requires_dist": null,
"requires_python": null,
"summary": "Lightweight and extensible caching framework for Python applications. It uses Redis as its storage backend.",
"version": "0.3"
},
"last_serial": 884464,
"releases": {
"0.1": [
{
"comment_text": "",
"digests": {
"md5": "559507644d085f2e43c4b0fad796c062",
"sha256": "a021b100e1ee305c92bba1f04d87482304318cf0d358e6cf282f4706591125e5"
},
"downloads": -1,
"filename": "RedCache-0.1.tar.gz",
"has_sig": false,
"md5_digest": "559507644d085f2e43c4b0fad796c062",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 16505,
"upload_time": "2012-11-01T15:05:51",
"url": "https://files.pythonhosted.org/packages/36/06/1290e147a691c25b74c6ae52b8f73fd4031e70466ab73e4a8a25a4d9a1cc/RedCache-0.1.tar.gz"
}
],
"0.2": [
{
"comment_text": "",
"digests": {
"md5": "bed56831feac846e5df1b9474fe3e365",
"sha256": "4a77aa7fa30d2b38f602c45b72715f79932f5400d8189b3ee12915ad5c33d814"
},
"downloads": -1,
"filename": "RedCache-0.2.tar.gz",
"has_sig": false,
"md5_digest": "bed56831feac846e5df1b9474fe3e365",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 19442,
"upload_time": "2012-11-17T14:54:12",
"url": "https://files.pythonhosted.org/packages/a2/e7/91a4baf75ef0bd838621afe43ef97fb139c3e42d7551eaa27752f3eb5771/RedCache-0.2.tar.gz"
}
],
"0.3": [
{
"comment_text": "",
"digests": {
"md5": "56b3109ead2e733b79a4e536d09cea7d",
"sha256": "2e6fe5e744c3b060b31b05209dc8bdacc95b774028ce220285246825e43f0828"
},
"downloads": -1,
"filename": "RedCache-0.3.tar.gz",
"has_sig": false,
"md5_digest": "56b3109ead2e733b79a4e536d09cea7d",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 19472,
"upload_time": "2013-10-08T18:41:28",
"url": "https://files.pythonhosted.org/packages/72/59/d4863bf190b55872e65e654d1ecceed49819895b738bf4cd28eae74e9cb8/RedCache-0.3.tar.gz"
}
]
},
"urls": [
{
"comment_text": "",
"digests": {
"md5": "56b3109ead2e733b79a4e536d09cea7d",
"sha256": "2e6fe5e744c3b060b31b05209dc8bdacc95b774028ce220285246825e43f0828"
},
"downloads": -1,
"filename": "RedCache-0.3.tar.gz",
"has_sig": false,
"md5_digest": "56b3109ead2e733b79a4e536d09cea7d",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 19472,
"upload_time": "2013-10-08T18:41:28",
"url": "https://files.pythonhosted.org/packages/72/59/d4863bf190b55872e65e654d1ecceed49819895b738bf4cd28eae74e9cb8/RedCache-0.3.tar.gz"
}
]
}