.. image:: https://badge.fury.io/py/anycache.svg
:target: https://badge.fury.io/py/anycache
.. image:: https://img.shields.io/pypi/dm/anycache.svg?label=pypi%20downloads
:target: https://pypi.python.org/pypi/anycache
.. image:: https://readthedocs.org/projects/anycache/badge/?version=latest
:target: https://anycache.readthedocs.io/en/latest/?badge=latest
.. image:: https://coveralls.io/repos/github/c0fec0de/anycache/badge.svg
:target: https://coveralls.io/github/c0fec0de/anycache
.. image:: https://readthedocs.org/projects/anycache/badge/?version=2.1.0
:target: https://anycache.readthedocs.io/en/2.1.0/?badge=2.1.0
.. image:: https://img.shields.io/pypi/pyversions/anycache.svg
:target: https://pypi.python.org/pypi/anycache
.. image:: https://img.shields.io/badge/code%20style-pep8-brightgreen.svg
:target: https://www.python.org/dev/peps/pep-0008/
.. image:: https://img.shields.io/badge/code%20style-pep257-brightgreen.svg
:target: https://www.python.org/dev/peps/pep-0257/
.. image:: https://img.shields.io/badge/linter-pylint-%231674b1?style=flat
:target: https://www.pylint.org/
.. image:: https://img.shields.io/badge/code%20style-black-000000.svg
:target: https://github.com/psf/black
.. image:: https://img.shields.io/github/contributors/c0fec0de/anycache.svg
:target: https://github.com/c0fec0de/anycache/graphs/contributors/
.. image:: https://img.shields.io/badge/PRs-welcome-brightgreen.svg?style=flat-square
:target: http://makeapullrequest.com
.. image:: https://img.shields.io/github/issues-pr/c0fec0de/anycache.svg
:target: https://github.com/c0fec0de/anycache/pulls
.. image:: https://img.shields.io/github/issues-pr-closed/c0fec0de/anycache.svg
:target: https://github.com/c0fec0de/anycache/pulls?q=is%3Apr+is%3Aclosed
To cache the result of a function, use the global unlimited anycache:
* Documentation_
* PyPI_
* GitHub_
* Changelog_
* Issues_
* Contributors_
.. _anycache: https://anycache.readthedocs.io/en//
.. _Documentation: https://anycache.readthedocs.io/en//
.. _PyPI: https://pypi.org/project/anycache//
.. _GitHub: https://github.com/c0fec0de/anycache
.. _Changelog: https://github.com/c0fec0de/anycache/releases
.. _Issues: https://github.com/c0fec0de/anycache/issues
.. _Contributors: https://github.com/c0fec0de/anycache/graphs/contributors
.. _getting_started:
>>> from anycache import anycache
>>> @anycache()
... def myfunc(posarg, kwarg=3):
... print(" Calcing %r + %r = %r" % (posarg, kwarg, posarg + kwarg))
... return posarg + kwarg
>>> myfunc(8, 5)
Calcing 8 + 5 = 13
13
>>> myfunc(8, 5)
13
`anycache` caches nearly any python object. Also `lambda` statements.
It uses Dill_ as backend. An improved version of pythons build-in `pickle`.
To preserve the result between multiple python runs, a persistent cache
directory needs to be set.
>>> from anycache import anycache
>>> @anycache(cachedir='/tmp/anycache.my')
... def myfunc(posarg, kwarg=3):
... return posarg + kwarg
The `AnyCache` object serves additional functions for cache clearing and
size handling.
.. _Dill: https://pypi.python.org/pypi/dill
Installation
============
To install the `anycache` module run::
pip install anycache
If you do not have write-permissions to the python installation, try::
pip install anycache --user
Raw data
{
"_id": null,
"home_page": null,
"name": "anycache",
"maintainer": null,
"docs_url": null,
"requires_python": "<4,>=3.8",
"maintainer_email": null,
"keywords": "cache, caching, cache file, pickle, dill",
"author": "c0fec0de",
"author_email": "c0fec0de@gmail.com",
"download_url": "https://files.pythonhosted.org/packages/12/26/012addbbe17a2a26ace080f391a7ce3a45ed12a908846135afd8202a488b/anycache-2.2.0.tar.gz",
"platform": null,
"description": "\n.. image:: https://badge.fury.io/py/anycache.svg\n :target: https://badge.fury.io/py/anycache\n\n.. image:: https://img.shields.io/pypi/dm/anycache.svg?label=pypi%20downloads\n :target: https://pypi.python.org/pypi/anycache\n\n.. image:: https://readthedocs.org/projects/anycache/badge/?version=latest\n :target: https://anycache.readthedocs.io/en/latest/?badge=latest\n\n.. image:: https://coveralls.io/repos/github/c0fec0de/anycache/badge.svg\n :target: https://coveralls.io/github/c0fec0de/anycache\n\n.. image:: https://readthedocs.org/projects/anycache/badge/?version=2.1.0\n :target: https://anycache.readthedocs.io/en/2.1.0/?badge=2.1.0\n\n.. image:: https://img.shields.io/pypi/pyversions/anycache.svg\n :target: https://pypi.python.org/pypi/anycache\n\n.. image:: https://img.shields.io/badge/code%20style-pep8-brightgreen.svg\n :target: https://www.python.org/dev/peps/pep-0008/\n\n.. image:: https://img.shields.io/badge/code%20style-pep257-brightgreen.svg\n :target: https://www.python.org/dev/peps/pep-0257/\n\n.. image:: https://img.shields.io/badge/linter-pylint-%231674b1?style=flat\n :target: https://www.pylint.org/\n\n.. image:: https://img.shields.io/badge/code%20style-black-000000.svg\n :target: https://github.com/psf/black\n\n.. image:: https://img.shields.io/github/contributors/c0fec0de/anycache.svg\n :target: https://github.com/c0fec0de/anycache/graphs/contributors/\n\n.. image:: https://img.shields.io/badge/PRs-welcome-brightgreen.svg?style=flat-square\n :target: http://makeapullrequest.com\n\n.. image:: https://img.shields.io/github/issues-pr/c0fec0de/anycache.svg\n :target: https://github.com/c0fec0de/anycache/pulls\n\n.. image:: https://img.shields.io/github/issues-pr-closed/c0fec0de/anycache.svg\n :target: https://github.com/c0fec0de/anycache/pulls?q=is%3Apr+is%3Aclosed\n\nTo cache the result of a function, use the global unlimited anycache:\n\n* Documentation_\n* PyPI_\n* GitHub_\n* Changelog_\n* Issues_\n* Contributors_\n\n.. _anycache: https://anycache.readthedocs.io/en//\n.. _Documentation: https://anycache.readthedocs.io/en//\n.. _PyPI: https://pypi.org/project/anycache//\n.. _GitHub: https://github.com/c0fec0de/anycache\n.. _Changelog: https://github.com/c0fec0de/anycache/releases\n.. _Issues: https://github.com/c0fec0de/anycache/issues\n.. _Contributors: https://github.com/c0fec0de/anycache/graphs/contributors\n\n.. _getting_started:\n\n>>> from anycache import anycache\n>>> @anycache()\n... def myfunc(posarg, kwarg=3):\n... print(\" Calcing %r + %r = %r\" % (posarg, kwarg, posarg + kwarg))\n... return posarg + kwarg\n>>> myfunc(8, 5)\n Calcing 8 + 5 = 13\n13\n>>> myfunc(8, 5)\n13\n\n`anycache` caches nearly any python object. Also `lambda` statements.\nIt uses Dill_ as backend. An improved version of pythons build-in `pickle`.\n\nTo preserve the result between multiple python runs, a persistent cache\ndirectory needs to be set.\n\n>>> from anycache import anycache\n>>> @anycache(cachedir='/tmp/anycache.my')\n... def myfunc(posarg, kwarg=3):\n... return posarg + kwarg\n\nThe `AnyCache` object serves additional functions for cache clearing and\nsize handling.\n\n.. _Dill: https://pypi.python.org/pypi/dill\n\nInstallation\n============\n\nTo install the `anycache` module run::\n\n pip install anycache\n\nIf you do not have write-permissions to the python installation, try::\n\n pip install anycache --user\n",
"bugtrack_url": null,
"license": "Apache-2.0",
"summary": "Cache any python object to file using improved pickling",
"version": "2.2.0",
"project_urls": null,
"split_keywords": [
"cache",
" caching",
" cache file",
" pickle",
" dill"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "3ff47b2e6f8f2060ce5ee349c3ccc6eba2ae91c01ad4c428c0965fa7bc3bb6d2",
"md5": "dece21544ca229333d3c5f2b3568c6f9",
"sha256": "f4c23284b33bab5f7f46c5d6f024025b944c8a223eb8638f497b68c9913c8922"
},
"downloads": -1,
"filename": "anycache-2.2.0-py3-none-any.whl",
"has_sig": false,
"md5_digest": "dece21544ca229333d3c5f2b3568c6f9",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": "<4,>=3.8",
"size": 10778,
"upload_time": "2024-08-21T20:50:42",
"upload_time_iso_8601": "2024-08-21T20:50:42.181518Z",
"url": "https://files.pythonhosted.org/packages/3f/f4/7b2e6f8f2060ce5ee349c3ccc6eba2ae91c01ad4c428c0965fa7bc3bb6d2/anycache-2.2.0-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "1226012addbbe17a2a26ace080f391a7ce3a45ed12a908846135afd8202a488b",
"md5": "54bcd67c8b20cbf0f8d780a49c10e685",
"sha256": "342ca6bf952f1b62f8725c92b50244f9ef6d0eb1547df768fe2ea2aa429f5c44"
},
"downloads": -1,
"filename": "anycache-2.2.0.tar.gz",
"has_sig": false,
"md5_digest": "54bcd67c8b20cbf0f8d780a49c10e685",
"packagetype": "sdist",
"python_version": "source",
"requires_python": "<4,>=3.8",
"size": 10660,
"upload_time": "2024-08-21T20:50:43",
"upload_time_iso_8601": "2024-08-21T20:50:43.548145Z",
"url": "https://files.pythonhosted.org/packages/12/26/012addbbe17a2a26ace080f391a7ce3a45ed12a908846135afd8202a488b/anycache-2.2.0.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-08-21 20:50:43",
"github": false,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"lcname": "anycache"
}