{ "info": { "author": "Tommy MacWilliam", "author_email": "tmacwilliam@cs.harvard.edu", "bugtrack_url": null, "classifiers": [ "Development Status :: 4 - Beta", "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Programming Language :: Python :: 3 :: Only" ], "description": "Rupee: Python [STRIKEOUT:Cashing] Caching\n=========================================\n\nRupee is a simple, but fully-featured caching library for Python 3.\n\nEngines\n-------\n\nRupee supports caching using process memory, Redis, and Memcached.\n\nFor Redis support:\n\n::\n\n pip install redis\n\nFor Memcached support, you can use ``pylibmc``:\n\n::\n\n pip install pylibmc\n\nor ``python-memcache``:\n\n::\n\n pip install python-memcache\n\nCache Access\n------------\n\nYou can create cache instances like this:\n\n::\n\n memory = rupee.engine.Memory()\n memcached = rupee.engine.Memcached(['localhost:11211'])\n redis = rupee.engine.Redis('localhost:6379')\n\nAll instances conform to the same API, which offer the get/set/delete\noperations you'd expect:\n\n::\n\n cache = rupee.engine.Memcached(['localhost:11211'])\n cache.set('foo', 'bar', ttl=3600)\n cache.set_multi({'baz': 1, 'qux': 2})\n cache.get('baz') == 1\n cache.get_multi(['foo', 'qux']) == {'foo': 'bar', 'qux': 2}\n cache.delete('qux')\n cache.delete_all(['foo', 'baz'])\n cache.delete_all_data()\n\nCached Decorators\n-----------------\n\nYou can decorate functions to be cache their results:\n\n::\n\n cache = rupee.engine.Redis('localhost:6379')\n\n @rupee.cached(cache, ttl=3600)\n def foo(bar, baz):\n return _some_expensive_thing(bar, baz)\n\nTo clear the cache entry for a function call:\n\n::\n\n foo.dirty(1, 2)\n\nFor functions that perform bulk operations, you can use the multi-cache\ndecorator:\n\n::\n\n @rupee.multi_cached(cache):\n def get(items):\n return {item: _some_expensive_thing(item) for item in items}\n\nFunctions decorated with ``multi_cached`` must take a single list as an\nargument and return a dictionary keyed on the items in that list. Then,\nresults for each item will be cached separately, and only the needed\nitems will be passed to the function. To illustrate:\n\n::\n\n get([1, 2, 3]) # calls _some_expensive_thing on 1, 2, and 3\n get([1, 2, 3]) # _some_expensive_thing is never called\n get([2, 3, 4]) # calls _some_expensive_thing only on 4", "description_content_type": null, "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/tmacwill/rupee", "keywords": "cache caching redis memcache memcached", "license": "MIT", "maintainer": "", "maintainer_email": "", "name": "rupee", "package_url": "https://pypi.org/project/rupee/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/rupee/", "project_urls": { "Homepage": "https://github.com/tmacwill/rupee" }, "release_url": "https://pypi.org/project/rupee/0.0.1/", "requires_dist": null, "requires_python": "", "summary": "A fully-featured cache for Python applications.", "version": "0.0.1" }, "last_serial": 2924079, "releases": { "0.0.1": [ { "comment_text": "", "digests": { "md5": "8171e32e91d4d0253bd8c5a1d5fccd42", "sha256": "97849f3b53715a44ca6a80e5a65e8df79fa4545969159553eb6246d2cee7466a" }, "downloads": -1, "filename": "rupee-0.0.1-py3-none-any.whl", "has_sig": false, "md5_digest": "8171e32e91d4d0253bd8c5a1d5fccd42", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 8116, "upload_time": "2017-06-04T08:46:01", "url": "https://files.pythonhosted.org/packages/a5/51/e3fbccb9251a775b0a3247e7504ee56a88225bc60217d8f2991c255d4a53/rupee-0.0.1-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "155ff754846832dd0e3bbbbfbccbcb31", "sha256": "7ce5f82a883d713650ed38a7fc30f424077732b61dd0eae66919265869aa91a6" }, "downloads": -1, "filename": "rupee-0.0.1.tar.gz", "has_sig": false, "md5_digest": "155ff754846832dd0e3bbbbfbccbcb31", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5215, "upload_time": "2017-06-04T08:46:03", "url": "https://files.pythonhosted.org/packages/f3/74/655a22c011a8d16d884759dcd84c6e687cc26a09c2b81bb6ba968ce20491/rupee-0.0.1.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "8171e32e91d4d0253bd8c5a1d5fccd42", "sha256": "97849f3b53715a44ca6a80e5a65e8df79fa4545969159553eb6246d2cee7466a" }, "downloads": -1, "filename": "rupee-0.0.1-py3-none-any.whl", "has_sig": false, "md5_digest": "8171e32e91d4d0253bd8c5a1d5fccd42", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 8116, "upload_time": "2017-06-04T08:46:01", "url": "https://files.pythonhosted.org/packages/a5/51/e3fbccb9251a775b0a3247e7504ee56a88225bc60217d8f2991c255d4a53/rupee-0.0.1-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "155ff754846832dd0e3bbbbfbccbcb31", "sha256": "7ce5f82a883d713650ed38a7fc30f424077732b61dd0eae66919265869aa91a6" }, "downloads": -1, "filename": "rupee-0.0.1.tar.gz", "has_sig": false, "md5_digest": "155ff754846832dd0e3bbbbfbccbcb31", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5215, "upload_time": "2017-06-04T08:46:03", "url": "https://files.pythonhosted.org/packages/f3/74/655a22c011a8d16d884759dcd84c6e687cc26a09c2b81bb6ba968ce20491/rupee-0.0.1.tar.gz" } ] }