Metadata-Version: 2.4
Name: anycache
Version: 2.4.0
Summary: Cache any python object to file using improved pickling
Keywords: cache,caching,cache file,pickle,dill
Author-Email: Daniel Jakschik <c0fec0de@gmail.com>
License-Expression: MIT
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Classifier: Development Status :: 5 - Production/Stable
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Operating System :: OS Independent
Project-URL: Homepage, https://github.com/c0fec0de/anycache
Project-URL: Documentation, https://anycache.readthedocs.io/en/stable/
Project-URL: Bug Tracker, https://github.com/c0fec0de/anycache/issues
Requires-Python: <4.0,>=3.9.0
Requires-Dist: dill>=0.3.7
Requires-Dist: filelock>=3.13.0
Description-Content-Type: text/markdown

[![PyPI Version](https://badge.fury.io/py/anycache.svg)](https://badge.fury.io/py/anycache)
[![Python Build](https://github.com/c0fec0de/anycache/actions/workflows/main.yml/badge.svg)](https://github.com/c0fec0de/anycache/actions/workflows/main.yml)
[![Documentation](https://readthedocs.org/projects/anycache/badge/?version=stable)](https://anycache.readthedocs.io/en/stable/?badge=stable)
[![Coverage Status](https://coveralls.io/repos/github/c0fec0de/anycache/badge.svg?branch=main)](https://coveralls.io/github/c0fec0de/anycache?branch=main)
[![python-versions](https://img.shields.io/pypi/pyversions/anycache.svg)](https://pypi.python.org/pypi/anycache)

# Cache any python object to file using improved pickling

* [Documentation](https://anycache.readthedocs.io/en/stable/)
* [PyPI](https://pypi.org/project/anycache/)
* [Sources](https://github.com/c0fec0de/anycache)
* [Issues](https://github.com/c0fec0de/anycache/issues)

## Installation

Installing it is pretty easy:

```bash
pip install anycache
```

## Getting Started

```python
>>> 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](https://pypi.python.org/pypi/dill) as backend. An improved version of pythons built-in `pickle`.

To preserve the result between multiple python runs, set a persistent cache
directory.

```python
>>> 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.
