{ "info": { "author": "Radek Sprta", "author_email": "mail@radeksprta.eu", "bugtrack_url": null, "classifiers": [ "Development Status :: 5 - Production/Stable", "License :: OSI Approved :: MIT License", "Natural Language :: English", "Operating System :: OS Independent", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.5", "Programming Language :: Python :: 3.6", "Programming Language :: Python :: 3.7", "Topic :: Database", "Topic :: Software Development :: Libraries" ], "description": "# Cachalot [![PyPI version](https://badge.fury.io/py/cachalot.svg)](https://badge.fury.io/py/cachalot) [![Pipeline status](https://gitlab.com/radek-sprta/cachalot/badges/master/pipeline.svg)](https://gitlab.com/radek-sprta/cachalot/commits/master) [![Coverage report](https://gitlab.com/radek-sprta/cachalot/badges/master/coverage.svg)](https://gitlab.com/radek-sprta/cachalot/commits/master)\n\nCachalot is a minimal persistent memoization cache. It provides a decorator, that stores function result for future use. Perfect for heavy computations and I/O operation (such as web requests). On backend, it uses TinyDB for storage.\n\n## Features\n- Simple usage via decorator\n- Persistent caching\n- Key expiration\n- Maximum cache size, to prevent bloat\n\n## Installation\nCachalot requires Python 3.5 or newer to run.\n\n**Python package**\n\nYou can easily install Cachalot using pip:\n\n`pip3 install cachalot`\n\n**Manual**\n\nAlternatively, to get the latest development version, you can clone this repository and then manually install it:\n\n```\ngit clone git@gitlab.com:radek-sprta/cachalot.git\ncd cachalot\npython3 setup.py install\n```\n\n## Usage\n```python\nfrom cachalot import Cache\n\n@Cache()\ndef expensive_function():\n return expensive_calculation()\n```\n\n### Advanced usage\n```python\nfrom cachalot import Cache\n\n@Cache(path='cache.json', timeout=3600, size=5e3, filesize=1e6, retry=True, renew_on_read=True)\ndef expensive_function():\n return expensive_calculation()\n```\n\n- `path`: Path to the database file. Defaults to .cache.json.\n- `timeout`: How long should the data be cached in seconds. Defaults to 0 (infinite).\n- `size`: Maximum number of keys cached. Defaults to 0 (infinite).\n- `filesize`: Maximum size of database file in bytes. Defaults to 0 (infinite).\n- `retry`: Retry if result is blank. Defaults to False.\n- `renew_on_read`: Renew the entry, i.e refresh the entry timestamp on reads. Defaults to True\n\nFor more information, see [documentation][documentation].\n\n## Contributing\nFor information on how to contribute to the project, please check the [Contributor's Guide][contributing]\n\n## Contact\n[mail@radeksprta.eu](mailto:mail@radeksprta.eu)\n\n[incoming+radek-sprta/cachalot@gitlab.com](incoming+radek-sprta/cachalot@gitlab.com)\n\n## License\nMIT License\n\n## Credits\nThis package was created with [Cookiecutter][cookiecutter] and the [python-cookiecutter][python-cookiecutter] project template. Inspired by [Cashier][cachier]\n\n[cachier]: https://github.com/atmb4u/cashier\n[contributing]: https://gitlab.com/radek-sprta/cachalot/blob/master/CONTRIBUTING.md\n[cookiecutter]: https://github.com/audreyr/cookiecutter\n[documentation]: https://radek-sprta.gitlab.io/cachalot\n[python-cookiecutter]: https://gitlab.com/radek-sprta/python-cookiecutter\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://radek-sprta.gitlab.io/cachalot/", "keywords": "memoization,cache", "license": "MIT", "maintainer": "", "maintainer_email": "", "name": "cachalot", "package_url": "https://pypi.org/project/cachalot/", "platform": "", "project_url": "https://pypi.org/project/cachalot/", "project_urls": { "Documentation": "https://radek-sprta.gitlab.io/cachalot/", "Homepage": "https://radek-sprta.gitlab.io/cachalot/", "Repository": "https://gitlab.com/radek-sprta/cachalot" }, "release_url": "https://pypi.org/project/cachalot/1.3.0/", "requires_dist": [ "jsonpickle", "tinydb", "tinydb-smartcache" ], "requires_python": ">=3.5,<4.0", "summary": "Minimal persistent memoization cache", "version": "1.3.0" }, "last_serial": 5973402, "releases": { "0.1.0": [ { "comment_text": "", "digests": { "md5": "52901d0a6e6a27aa724706881491e344", "sha256": "e3758622658fa13c2ba610eff86a0df572bc3b5f9cc672abc9e037b9d7b45984" }, "downloads": -1, "filename": "cachalot-0.1.0-py3.6.egg", "has_sig": false, "md5_digest": "52901d0a6e6a27aa724706881491e344", "packagetype": "bdist_egg", "python_version": "3.6", "requires_python": ">=3.5", "size": 6224, "upload_time": "2018-01-28T12:53:08", "url": "https://files.pythonhosted.org/packages/b7/d4/c1dcb0f6d2977af4d283a4ac1d4653d2a866b3e865ec4753e06b48dd4780/cachalot-0.1.0-py3.6.egg" }, { "comment_text": "", "digests": { "md5": "c998513cd0b86ef95cb3af2b857a2ef1", "sha256": "95af354e5c925c111f259c86778c1e198899a904cdfb2ee07ab9c3faa9c641ea" }, "downloads": -1, "filename": "cachalot-0.1.0-py3-none-any.whl", "has_sig": false, "md5_digest": "c998513cd0b86ef95cb3af2b857a2ef1", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3.5", "size": 5842, "upload_time": "2018-01-28T12:53:05", "url": "https://files.pythonhosted.org/packages/5d/ee/d162bc2aa4e4580ebb694bf249820293164270cef660db5a9bdf0dbb94cc/cachalot-0.1.0-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "a86d6b7f8479f35589c9f933829e16da", "sha256": "48e6bd89839a120bfa2b08ad3fa1239ff9fa4c5c6e5d0197b88d1af6ee1bf308" }, "downloads": -1, "filename": "cachalot-0.1.0.tar.gz", "has_sig": false, "md5_digest": "a86d6b7f8479f35589c9f933829e16da", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.5", "size": 6979, "upload_time": "2018-01-28T12:53:10", "url": "https://files.pythonhosted.org/packages/3f/ef/aa6b8b6ccc18a7274751c311c03b7d6cec72e978f2821a0b66a7dbb0585f/cachalot-0.1.0.tar.gz" } ], "0.1.1": [ { "comment_text": "", "digests": { "md5": "c43f73c818d7b86ec21b85d5f3b1ce2e", "sha256": "af9ab5bf479307e17421cd43faa401c5442f5d360185b3c7be964454ebc67a8f" }, "downloads": -1, "filename": "cachalot-0.1.1-py3-none-any.whl", "has_sig": false, "md5_digest": "c43f73c818d7b86ec21b85d5f3b1ce2e", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3.5", "size": 6026, "upload_time": "2018-02-11T14:17:29", "url": "https://files.pythonhosted.org/packages/76/89/939f5fa0c5c8e57a042e5c87717ef62fe802a359d8ec8e9fb9927a76b0ef/cachalot-0.1.1-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "4e6e98414e67fc15ecce6c7ced9a491d", "sha256": "86fb0f815c75ced189a276a2f2428cd783e8f0a287fe116247e0ad88a7f43a6b" }, "downloads": -1, "filename": "cachalot-0.1.1.tar.gz", "has_sig": false, "md5_digest": "4e6e98414e67fc15ecce6c7ced9a491d", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.5", "size": 7420, "upload_time": "2018-02-11T14:17:31", "url": "https://files.pythonhosted.org/packages/b0/d5/1b78fda85ec986c921b26d6e1c6764229c6c26e03dee337ebdd2861b5485/cachalot-0.1.1.tar.gz" } ], "0.1.2": [ { "comment_text": "", "digests": { "md5": "29939781119542c616bc89243288cf47", "sha256": "bf8f4ec70760b9fff190129dbd5ccec0f67cc78d0031f50ad312a7cd6f2eff37" }, "downloads": -1, "filename": "cachalot-0.1.2-py3-none-any.whl", "has_sig": false, "md5_digest": "29939781119542c616bc89243288cf47", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3.5", "size": 5968, "upload_time": "2018-02-28T10:37:29", "url": "https://files.pythonhosted.org/packages/20/04/222c4f3ac74a2f62c343ec1ef99f984c766a52e0d2aaac72fef192d819dd/cachalot-0.1.2-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "4a7d3780370ad4d1ff46ea0e2e1c7d8c", "sha256": "c38abbf308ae586c099c31524250fd02ad085e24fc18598b1082ccc8cc5dd258" }, "downloads": -1, "filename": "cachalot-0.1.2.tar.gz", "has_sig": false, "md5_digest": "4a7d3780370ad4d1ff46ea0e2e1c7d8c", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.5", "size": 7191, "upload_time": "2018-02-28T10:37:32", "url": "https://files.pythonhosted.org/packages/50/7a/a96242ebc6659a26a504d7f6890446f52246bba788009118ab4c567b651f/cachalot-0.1.2.tar.gz" } ], "0.1.3": [ { "comment_text": "", "digests": { "md5": "ecda443f544a52287b0314b7530fe048", "sha256": "4ffa6c8f82256b5b71e0fb41c4316629567a800d80553a2f0a27033cc003676c" }, "downloads": -1, "filename": "cachalot-0.1.3-py3-none-any.whl", "has_sig": false, "md5_digest": "ecda443f544a52287b0314b7530fe048", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3.5", "size": 4066, "upload_time": "2018-05-16T11:31:41", "url": "https://files.pythonhosted.org/packages/a0/25/ec951f15fa8cefe49feecf4b78015665953ed39dddcf1b6d3f9f6a9652e6/cachalot-0.1.3-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "9bf4d6e5d162db19a93c161c38b562d7", "sha256": "fb299bdf4d10dea717d6bc5a49adf407b7d11ae9eec98b4f93232236f429096a" }, "downloads": -1, "filename": "cachalot-0.1.3.tar.gz", "has_sig": false, "md5_digest": "9bf4d6e5d162db19a93c161c38b562d7", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.5", "size": 7358, "upload_time": "2018-05-16T11:31:43", "url": "https://files.pythonhosted.org/packages/c3/87/37dead994f3010bb2be5f1303f601165ccba85a2f811dccf5dce26223e56/cachalot-0.1.3.tar.gz" } ], "0.2.0": [ { "comment_text": "", "digests": { "md5": "4f22241e0a156da791260dcbda346749", "sha256": "f93927d05661b1062402fcd04c637425bcfc7355322c461b2b870d3136cff1e4" }, "downloads": -1, "filename": "cachalot-0.2.0-py3-none-any.whl", "has_sig": false, "md5_digest": "4f22241e0a156da791260dcbda346749", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3.5", "size": 4173, "upload_time": "2018-07-09T15:12:31", "url": "https://files.pythonhosted.org/packages/81/96/d1f962789579d14ee9ae0fb6edf1fb25307d1ee068e5f3a24e04e659fc81/cachalot-0.2.0-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "662625acc4a20f5bce6c2acd5272ee12", "sha256": "c0077b2db2881712cb0c06b81d42fd08222e301ca065c74243167019798f6000" }, "downloads": -1, "filename": "cachalot-0.2.0.tar.gz", "has_sig": false, "md5_digest": "662625acc4a20f5bce6c2acd5272ee12", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.5", "size": 8280, "upload_time": "2018-07-09T15:12:32", "url": "https://files.pythonhosted.org/packages/34/26/f16531f7d77535d68f9519038158ef416e4495c74a5bd30e878fd017f62d/cachalot-0.2.0.tar.gz" } ], "1.0.0": [ { "comment_text": "", "digests": { "md5": "9bf9d78b133b4638d1997ed57572157d", "sha256": "a4857910dccf421194691a1d84ab2c501d019e44804d96cd17d33236a93c9472" }, "downloads": -1, "filename": "cachalot-1.0.0-py3-none-any.whl", "has_sig": false, "md5_digest": "9bf9d78b133b4638d1997ed57572157d", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3.5", "size": 4183, "upload_time": "2019-02-01T10:18:05", "url": "https://files.pythonhosted.org/packages/cd/4d/40a45ee90a15b338d85cdac022a7fbc1799b29a1ab56da3f5efb6a686bb5/cachalot-1.0.0-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "91597105899caf99065f19d45de8ebb7", "sha256": "21fa6926e011134050727d2df6a9a40bf4171fc89a937cc93dc3f7c5f9d4844b" }, "downloads": -1, "filename": "cachalot-1.0.0.tar.gz", "has_sig": false, "md5_digest": "91597105899caf99065f19d45de8ebb7", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.5", "size": 8407, "upload_time": "2019-02-01T10:18:07", "url": "https://files.pythonhosted.org/packages/ff/27/b34a14d283c7bf9129103db710768c68682e2fc40279803a1a6329f010ec/cachalot-1.0.0.tar.gz" } ], "1.1.0": [ { "comment_text": "", "digests": { "md5": "81144eb113339011ec96d2b070fd92a8", "sha256": "b108fab0691438bad5cca29fadf87e430c78e0228f98fd1c46c4f5ad93919ff8" }, "downloads": -1, "filename": "cachalot-1.1.0-py3-none-any.whl", "has_sig": false, "md5_digest": "81144eb113339011ec96d2b070fd92a8", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3.5", "size": 4232, "upload_time": "2019-02-25T11:52:20", "url": "https://files.pythonhosted.org/packages/bf/72/8debb4c935dff4a884a2ea6fdc4507660608ed4233f7b42657330af1f2c6/cachalot-1.1.0-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "824edbc2cc215eca45caef75c687f71f", "sha256": "e276bc1961e0c6461ec7ef495f91335cb79493d47320a1a5f66cee6cec5e350e" }, "downloads": -1, "filename": "cachalot-1.1.0.tar.gz", "has_sig": false, "md5_digest": "824edbc2cc215eca45caef75c687f71f", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.5", "size": 8610, "upload_time": "2019-02-25T11:52:22", "url": "https://files.pythonhosted.org/packages/9f/60/dfa13ca46d855f2754b8515e5ae980eb20e22cf4b097d1742dfb947f820c/cachalot-1.1.0.tar.gz" } ], "1.3.0": [ { "comment_text": "", "digests": { "md5": "12ce3fe4fb9b70b8b56fee4fabbf9226", "sha256": "d652cf56b1d4fef0cfd77c52ad98308d74ba1e5785eb68067b598b4a1afcc830" }, "downloads": -1, "filename": "Cachalot-1.3.0-py3-none-any.whl", "has_sig": false, "md5_digest": "12ce3fe4fb9b70b8b56fee4fabbf9226", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3.5,<4.0", "size": 7948, "upload_time": "2019-10-14T21:00:26", "url": "https://files.pythonhosted.org/packages/4f/76/e6acfa77ad4d5a3e36cf6f1d4067298249db8a94b7f310ac6e7f0219b2e6/Cachalot-1.3.0-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "7c7b00fa9b60bb055df7fab63aa05526", "sha256": "09373fe999a37c9ea391f6c737449dd21cd92aa547c0c94e4e8b8e3cac9b1920" }, "downloads": -1, "filename": "Cachalot-1.3.0.tar.gz", "has_sig": false, "md5_digest": "7c7b00fa9b60bb055df7fab63aa05526", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.5,<4.0", "size": 6796, "upload_time": "2019-10-14T21:00:28", "url": "https://files.pythonhosted.org/packages/1e/77/30998e1431ef9375ea8f16ddb8dae443352816ae9a81a54440ef113d9972/Cachalot-1.3.0.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "12ce3fe4fb9b70b8b56fee4fabbf9226", "sha256": "d652cf56b1d4fef0cfd77c52ad98308d74ba1e5785eb68067b598b4a1afcc830" }, "downloads": -1, "filename": "Cachalot-1.3.0-py3-none-any.whl", "has_sig": false, "md5_digest": "12ce3fe4fb9b70b8b56fee4fabbf9226", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3.5,<4.0", "size": 7948, "upload_time": "2019-10-14T21:00:26", "url": "https://files.pythonhosted.org/packages/4f/76/e6acfa77ad4d5a3e36cf6f1d4067298249db8a94b7f310ac6e7f0219b2e6/Cachalot-1.3.0-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "7c7b00fa9b60bb055df7fab63aa05526", "sha256": "09373fe999a37c9ea391f6c737449dd21cd92aa547c0c94e4e8b8e3cac9b1920" }, "downloads": -1, "filename": "Cachalot-1.3.0.tar.gz", "has_sig": false, "md5_digest": "7c7b00fa9b60bb055df7fab63aa05526", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.5,<4.0", "size": 6796, "upload_time": "2019-10-14T21:00:28", "url": "https://files.pythonhosted.org/packages/1e/77/30998e1431ef9375ea8f16ddb8dae443352816ae9a81a54440ef113d9972/Cachalot-1.3.0.tar.gz" } ] }