{ "info": { "author": "Thomas Levine", "author_email": "_@thomaslevine.com", "bugtrack_url": null, "classifiers": [], "description": "Cache the results of a function.\n\nSimple use\n===============\nDecorate the function with ``@cache(cachedir, **kwargs)``.\nFor example, ::\n\n @cache()\n def is_prime(number):\n for n in range(2, number):\n if number % n == 0:\n return False\n return True\n\nFancier uses\n===============\n\nNon-default directory\n----------------------------\nIf you pass no arguments to cache, as in the example above,\nthe cache will be stored in a directory named after the function.\nTo set a different directory, pass it as an argument. ::\n\n @cache('~/.primes')\n def is_prime(number):\n for n in range(2, number):\n if number % n == 0:\n return False\n return True\n\nI recommend storing your caches in dotted directories under your\nhome directory, as you see above.\n\nConfiguration\n----------------------------\nThe kwargs get passed to the ``pickle_warehouse.Warehouse``, so you\ncan do fun things like changing the serialization function. ::\n\n @cache('~/.http', serializer = pickle_warehouse.serializers.identity)\n def get(url):\n return requests.get(url).text\n\nRead more about the keyword arguments on the\n`pickle-warehouse page `_.\n\nNon-identifying arguments\n----------------------------\nIf you want to pass an argument but not use it as an identifier,\npass a non-keyword argument; those get passed along to the function\nbut don't form the identifier. For example, ::\n\n @cache('~/.http')\n def get(url, auth = None):\n return requests.get(url, auth = auth)\n\n get('http://this.website.com', auth = ('username', 'password')\n\nRefreshing the cache\n==========================\nI find that I sometimes want to refresh the cache for a particular\nfile, only. This is usually because an error occurred and I have fixed\nthe error or because I am downloading files from a website that doesn't\nwork very well.\n\nIt would be nice to have a convenient way of refreshing these files.\nUntil then, I suggest that you log the arguments to the function call\nthat yields the cached error and then delete the corresponding file.\n", "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/tlevine/picklecache", "keywords": null, "license": "AGPL", "maintainer": null, "maintainer_email": null, "name": "picklecache", "package_url": "https://pypi.org/project/picklecache/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/picklecache/", "project_urls": { "Download": "UNKNOWN", "Homepage": "https://github.com/tlevine/picklecache" }, "release_url": "https://pypi.org/project/picklecache/0.0.5/", "requires_dist": null, "requires_python": null, "summary": "Cache functions with pickle and files", "version": "0.0.5" }, "last_serial": 1177474, "releases": { "0.0.1": [ { "comment_text": "", "digests": { "md5": "032d5baae3f837669840fae8454094ac", "sha256": "d6455134b6409e77a9d1f147d64de275a33701a044b795167bb645ea17230255" }, "downloads": -1, "filename": "picklecache-0.0.1.tar.gz", "has_sig": false, "md5_digest": "032d5baae3f837669840fae8454094ac", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 962, "upload_time": "2014-04-24T17:04:25", "url": "https://files.pythonhosted.org/packages/59/a7/c0684794843bf91c4c87280c461e6aa6fecf8d7ecb5105cce00790d73f7c/picklecache-0.0.1.tar.gz" } ], "0.0.2": [ { "comment_text": "", "digests": { "md5": "db94c4c340436e51a55dbba6f7b48088", "sha256": "faf7a40e72e9b3c2bc7a7ba8fb4a880448832147a92d82d87276a2f9addd2de8" }, "downloads": -1, "filename": "picklecache-0.0.2.tar.gz", "has_sig": false, "md5_digest": "db94c4c340436e51a55dbba6f7b48088", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 1142, "upload_time": "2014-05-02T12:12:26", "url": "https://files.pythonhosted.org/packages/ac/99/2abf638399c9be9a697a11ac495d58f9c5060f3be9592901ebf4cd288d07/picklecache-0.0.2.tar.gz" } ], "0.0.3": [ { "comment_text": "", "digests": { "md5": "b0ba0420a133afd7764cdcbd38e731e1", "sha256": "6f65cdcda8a4f595821940c5f99746abb85261bdb905ddef4c3947c7d2d8ce0b" }, "downloads": -1, "filename": "picklecache-0.0.3.tar.gz", "has_sig": false, "md5_digest": "b0ba0420a133afd7764cdcbd38e731e1", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 1176, "upload_time": "2014-05-08T14:51:24", "url": "https://files.pythonhosted.org/packages/73/64/aa45e39109197c7291bbd5f0f2f82890c24f79b0ef2beea9bb3fe6a30c7e/picklecache-0.0.3.tar.gz" } ], "0.0.4": [ { "comment_text": "", "digests": { "md5": "f7b29749aa844f5ad694d3851ca5bf49", "sha256": "11150a7bbd32f8c8dd9d88e10c5dbc7e95d23ebb2f8e308c980bcc498c9b3014" }, "downloads": -1, "filename": "picklecache-0.0.4.tar.gz", "has_sig": false, "md5_digest": "f7b29749aa844f5ad694d3851ca5bf49", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 1138, "upload_time": "2014-05-30T14:32:49", "url": "https://files.pythonhosted.org/packages/be/fc/b8e7097387539fc14c71f6853ab1e7abe5a8ba3e7feed55c262c5514a4eb/picklecache-0.0.4.tar.gz" } ], "0.0.5": [ { "comment_text": "", "digests": { "md5": "52bfe5dbb47015ddfe60f836d12d6793", "sha256": "23e94d2cf86c05b1c4404e89aecabe2bd8ee1c43f221dcd8dec7456b5aa75bd4" }, "downloads": -1, "filename": "picklecache-0.0.5.tar.gz", "has_sig": false, "md5_digest": "52bfe5dbb47015ddfe60f836d12d6793", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 1963, "upload_time": "2014-08-02T10:18:48", "url": "https://files.pythonhosted.org/packages/d3/52/e3b28339f1bdac1af77c4aa2275c9f5b5d0a6303f05acc0f1693596c68c7/picklecache-0.0.5.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "52bfe5dbb47015ddfe60f836d12d6793", "sha256": "23e94d2cf86c05b1c4404e89aecabe2bd8ee1c43f221dcd8dec7456b5aa75bd4" }, "downloads": -1, "filename": "picklecache-0.0.5.tar.gz", "has_sig": false, "md5_digest": "52bfe5dbb47015ddfe60f836d12d6793", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 1963, "upload_time": "2014-08-02T10:18:48", "url": "https://files.pythonhosted.org/packages/d3/52/e3b28339f1bdac1af77c4aa2275c9f5b5d0a6303f05acc0f1693596c68c7/picklecache-0.0.5.tar.gz" } ] }