{ "info": { "author": "Matthew Rocklin", "author_email": "mrocklin@gmail.com", "bugtrack_url": null, "classifiers": [], "description": "Caching for Analytic Computations\n---------------------------------\n\nHumans repeat stuff. Caching helps.\n\nNormal caching policies like LRU aren't well suited for analytic computations\nwhere both the cost of recomputation and the cost of storge routinely vary by\none milllion or more. Consider the following computations\n\n```python\n# Want this\nnp.std(x) # tiny result, costly to recompute\n\n# Don't want this\nnp.transpose(x) # huge result, cheap to recompute\n```\n\nCachey tries to hold on to values that have the following characteristics\n\n1. Expensive to recompute (in seconds)\n2. Cheap to store (in bytes)\n3. Frequently used\n4. Recenty used\n\nIt accomplishes this by adding the following to each items score on each access\n\n score += compute_time / num_bytes * (1 + eps) ** tick_time\n\nFor some small value of epsilon (which determines the memory halflife.) This\nhas units of inverse bandwidth, has exponential decay of old results and\nroughly linear amplification of repeated results.\n\nExample\n-------\n\n```python\n>>> from cachey import Cache\n>>> c = Cache(1e9, 1) # 1 GB, cut off anything with cost 1 or less\n\n>>> c.put('x', 'some value', cost=3)\n>>> c.put('y', 'other value', cost=2)\n\n>>> c.get('x')\n'some value'\n```\n\nThis also has a `memoize` method\n\n```python\n>>> memo_f = c.memoize(f)\n```\n\nStatus\n------\n\nCachey is new and not robust.", "description_content_type": null, "docs_url": null, "download_url": "UNKNOWN", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "http://github.com/mrocklin/cachey/", "keywords": "", "license": "BSD", "maintainer": null, "maintainer_email": null, "name": "cachey", "package_url": "https://pypi.org/project/cachey/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/cachey/", "project_urls": { "Download": "UNKNOWN", "Homepage": "http://github.com/mrocklin/cachey/" }, "release_url": "https://pypi.org/project/cachey/0.1.1/", "requires_dist": null, "requires_python": null, "summary": "Caching mindful of computation/storage costs", "version": "0.1.1" }, "last_serial": 5809917, "releases": { "0.0.1": [ { "comment_text": "built for Linux-3.13.0-59-generic-x86_64-with-glibc2.2.5", "digests": { "md5": "14da2ec7c85e5af0e4760065e8916973", "sha256": "cb631598779aab452c11b34f7ca97d538e2330b3614c2bbdd17156c45543824a" }, "downloads": -1, "filename": "cachey-0.0.1.linux-x86_64.tar.gz", "has_sig": false, "md5_digest": "14da2ec7c85e5af0e4760065e8916973", "packagetype": "bdist_dumb", "python_version": "any", "requires_python": null, "size": 6380, "upload_time": "2015-08-02T22:15:05", "url": "https://files.pythonhosted.org/packages/8e/ee/503480aac07de9a880bfecac6f84a4378a8eefb0c38e7078a890150053d6/cachey-0.0.1.linux-x86_64.tar.gz" }, { "comment_text": "", "digests": { "md5": "f06cf90642e9c754c90275a201d97071", "sha256": "190b96e9bb44de5a210b082036175aefa63336902ba4ab9f497a97bd59296cfe" }, "downloads": -1, "filename": "cachey-0.0.1.tar.gz", "has_sig": false, "md5_digest": "f06cf90642e9c754c90275a201d97071", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3913, "upload_time": "2015-08-02T22:14:57", "url": "https://files.pythonhosted.org/packages/86/0b/9039c2fceec2e8467be83ec24b2da257c3bc2e00b1a44d09bf991d31b444/cachey-0.0.1.tar.gz" } ], "0.0.2": [ { "comment_text": "", "digests": { "md5": "1d5d9de540a2e561c61e65e858c4682c", "sha256": "2fd5d3fe9ea9201b6ac1a833f42c126370f49d6f4b6643dd4006fa8a74abcf30" }, "downloads": -1, "filename": "cachey-0.0.2.tar.gz", "has_sig": false, "md5_digest": "1d5d9de540a2e561c61e65e858c4682c", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5529, "upload_time": "2015-08-03T00:52:40", "url": "https://files.pythonhosted.org/packages/b9/4f/afcb3d4efa4d23369512f4e428d67473ec3ec6dff1d85f1a8f2ba9c644cc/cachey-0.0.2.tar.gz" } ], "0.0.3": [ { "comment_text": "", "digests": { "md5": "949005a21c7d9139127cf7765e16a992", "sha256": "282af43fbd8cd0523244acc5a6d7347d6e2260505ca998e0dde181aadae10fd6" }, "downloads": -1, "filename": "cachey-0.0.3.tar.gz", "has_sig": false, "md5_digest": "949005a21c7d9139127cf7765e16a992", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5541, "upload_time": "2015-08-03T21:47:48", "url": "https://files.pythonhosted.org/packages/a9/2a/e249584157700d1c93a09514eab7b9fc7095c0affa44b72b64f434dec7ec/cachey-0.0.3.tar.gz" } ], "0.1.0": [ { "comment_text": "", "digests": { "md5": "a3504a4cdb707b3878d8fb2503e95ddd", "sha256": "04f1fff42ba91980ed7d82da81d64fd57ea30730d10d5e6436e1b91d917c34ce" }, "downloads": -1, "filename": "cachey-0.1.0.tar.gz", "has_sig": false, "md5_digest": "a3504a4cdb707b3878d8fb2503e95ddd", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6026, "upload_time": "2015-08-14T16:04:29", "url": "https://files.pythonhosted.org/packages/49/46/dcb3e37bcf370e507e9f4980b9fdc4eab0029c3a3c735f131c6ab077cc60/cachey-0.1.0.tar.gz" } ], "0.1.1": [ { "comment_text": "", "digests": { "md5": "c2102283a25e9c1995dc27d31ebb0070", "sha256": "de1db64409158d40acdfdd869ccbca7ce90b2f2ba20d44fb68f32e72f5679f21" }, "downloads": -1, "filename": "cachey-0.1.1.tar.gz", "has_sig": false, "md5_digest": "c2102283a25e9c1995dc27d31ebb0070", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6058, "upload_time": "2015-08-14T18:44:28", "url": "https://files.pythonhosted.org/packages/f8/a9/61f4a40e5a64ff8969c8f1716d0ecdd4309af7a545c2610abbc1034fddae/cachey-0.1.1.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "c2102283a25e9c1995dc27d31ebb0070", "sha256": "de1db64409158d40acdfdd869ccbca7ce90b2f2ba20d44fb68f32e72f5679f21" }, "downloads": -1, "filename": "cachey-0.1.1.tar.gz", "has_sig": false, "md5_digest": "c2102283a25e9c1995dc27d31ebb0070", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6058, "upload_time": "2015-08-14T18:44:28", "url": "https://files.pythonhosted.org/packages/f8/a9/61f4a40e5a64ff8969c8f1716d0ecdd4309af7a545c2610abbc1034fddae/cachey-0.1.1.tar.gz" } ] }