{ "info": { "author": "lwzm", "author_email": "lwzm@qq.com", "bugtrack_url": null, "classifiers": [ "Environment :: Console", "License :: OSI Approved :: MIT License", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.6", "Programming Language :: Python :: 3.7", "Programming Language :: Python :: Implementation :: CPython", "Programming Language :: Python :: Implementation :: PyPy", "Topic :: Software Development :: Libraries :: Python Modules" ], "description": "# ttl-cache\n\n### How to use it\n\n```sh\npip install ttl-cache\n```\n\n```python\nimport ttl_cache\n\n\n# use ttl_cache directly\n@ttl_cache\ndef expensive_operation(a, b):\n ...\n ...\n return SOME_RESULT\n\nexpensive_operation(xx, yy)\nexpensive_operation(xx, yy) # prefer cached result\n# ... 60 seconds later\nexpensive_operation(xx, yy) # compute again\n\n\n# or\n@ttl_cache(2.0) # cache the result in the next 2 seconds, default is 60.0 seconds\ndef expensive_operation(a, b):\n ...\n ...\n\n```", "description_content_type": "text/markdown", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/lwzm/ttl-cache", "keywords": "cache,ttl,decorator,functools", "license": "", "maintainer": "", "maintainer_email": "", "name": "ttl-cache", "package_url": "https://pypi.org/project/ttl-cache/", "platform": "", "project_url": "https://pypi.org/project/ttl-cache/", "project_urls": { "Homepage": "https://github.com/lwzm/ttl-cache" }, "release_url": "https://pypi.org/project/ttl-cache/1.5/", "requires_dist": null, "requires_python": "", "summary": "Decorator to wrap a function with a memoizing callable that has TTL result", "version": "1.5" }, "last_serial": 5724365, "releases": { "1.0": [ { "comment_text": "", "digests": { "md5": "37410c384a9ff8244a8db7b700af08ef", "sha256": "e88666909b554bc5f9f9da8a456aff882a3f6dc567d9366715b45497125973be" }, "downloads": -1, "filename": "ttl-cache-1.0.tar.gz", "has_sig": false, "md5_digest": "37410c384a9ff8244a8db7b700af08ef", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 1908, "upload_time": "2018-12-29T03:07:36", "url": "https://files.pythonhosted.org/packages/79/8c/c88c01a50f718753be4e262d6afaa18d093be8c6d607ecfd331fe774c3e3/ttl-cache-1.0.tar.gz" } ], "1.1": [ { "comment_text": "", "digests": { "md5": "8c5af1301787dab58b16bb2fa34bf98b", "sha256": "aa0579062175b1f0fe25dd4e5f0860c35e4632ebd3278db8884e3f113fa0f04e" }, "downloads": -1, "filename": "ttl-cache-1.1.tar.gz", "has_sig": false, "md5_digest": "8c5af1301787dab58b16bb2fa34bf98b", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 1936, "upload_time": "2019-01-03T10:26:54", "url": "https://files.pythonhosted.org/packages/9a/5f/4a6ab2e3463d2a90cf5c5c3b07edfc2d4255dd997f6fc329e4dbb559fb92/ttl-cache-1.1.tar.gz" } ], "1.2": [ { "comment_text": "", "digests": { "md5": "72dfd1ccc0d25d377c751163e9211873", "sha256": "c35e58eefee2d5ae1044a5414a1076a618199c56a151fe71b0f6b9c46f089eb7" }, "downloads": -1, "filename": "ttl-cache-1.2.tar.gz", "has_sig": false, "md5_digest": "72dfd1ccc0d25d377c751163e9211873", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 1972, "upload_time": "2019-01-04T02:29:27", "url": "https://files.pythonhosted.org/packages/56/98/b68a63829cc6dc613e24e2ad135fcc4b8b36b85e144998b909a05a1a3925/ttl-cache-1.2.tar.gz" } ], "1.3": [ { "comment_text": "", "digests": { "md5": "0f33cf1b8fc4866843b2d347daf0a517", "sha256": "7a8166c1a9a2eb5926ccd6731a9727088af89338ee05343f7680ef03decf903d" }, "downloads": -1, "filename": "ttl-cache-1.3.tar.gz", "has_sig": false, "md5_digest": "0f33cf1b8fc4866843b2d347daf0a517", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 2035, "upload_time": "2019-01-14T03:03:10", "url": "https://files.pythonhosted.org/packages/96/e1/8f886b5d755cb89fbde8a75f7f3e5870a82cdb29314edbf7fbfc7e082833/ttl-cache-1.3.tar.gz" } ], "1.4": [ { "comment_text": "", "digests": { "md5": "5c013a29056f8affbd469558bf77526d", "sha256": "9d1bde96b560b6dfb3237c0be740a5cfb6efd85b13391a17d2823bf595f590e7" }, "downloads": -1, "filename": "ttl-cache-1.4.tar.gz", "has_sig": false, "md5_digest": "5c013a29056f8affbd469558bf77526d", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 2035, "upload_time": "2019-01-16T09:16:58", "url": "https://files.pythonhosted.org/packages/fc/ed/7eab3b00fabcbd97ad93d50f76323a2f010bddd1c6075c02f4afb0ea1b76/ttl-cache-1.4.tar.gz" } ], "1.5": [ { "comment_text": "", "digests": { "md5": "6b38cfe94a945ea5d8c83d21e9dbf2f9", "sha256": "0cdc87b762d8e0b9015f4d4213e88a2c013863b55260fb0e4ae4a7fbc321201e" }, "downloads": -1, "filename": "ttl-cache-1.5.tar.gz", "has_sig": false, "md5_digest": "6b38cfe94a945ea5d8c83d21e9dbf2f9", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 2078, "upload_time": "2019-08-24T12:31:08", "url": "https://files.pythonhosted.org/packages/98/73/ab1396b708d0649c466e552847b7a9488250e08d2b616d7c6b44b16f3037/ttl-cache-1.5.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "6b38cfe94a945ea5d8c83d21e9dbf2f9", "sha256": "0cdc87b762d8e0b9015f4d4213e88a2c013863b55260fb0e4ae4a7fbc321201e" }, "downloads": -1, "filename": "ttl-cache-1.5.tar.gz", "has_sig": false, "md5_digest": "6b38cfe94a945ea5d8c83d21e9dbf2f9", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 2078, "upload_time": "2019-08-24T12:31:08", "url": "https://files.pythonhosted.org/packages/98/73/ab1396b708d0649c466e552847b7a9488250e08d2b616d7c6b44b16f3037/ttl-cache-1.5.tar.gz" } ] }