Skip to main content

PyPI Version Python Build Documentation Coverage Status python-versions

Cache any python object to file using improved pickling

Installation

Installing it is pretty easy:

pip install anycache

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 built-in pickle.

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

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

Metadata

Release files for anycache 2.4.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for anycache 2.4.0
File Size Uploaded
anycache-2.4.0.tar.gz 11.0 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for anycache 2.4.0
File Interpreter ABI Platform
anycache-2.4.0-py3-none-any.whl Python 3 none any Details

Total release size: 19.3 kB

Release files / anycache-2.4.0.tar.gz

Download URL anycache-2.4.0.tar.gz
Size 11.0 kB
Tags Source
SHA-256 checksum
How to use checksums
99d3da200c7890fc9bba2c6c05470d34789483ed0115ee2885b72753aa235629
BLAKE2b-256 checksum
How to use checksums
a22f780bebd471b5a0fb9f53928d96726c7f17450d4d291a61e1b61988bab09c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via pdm/2.23.0 CPython/3.13.2 Linux/6.8.0-1021-azure

Release files / anycache-2.4.0-py3-none-any.whl

Download URL anycache-2.4.0-py3-none-any.whl
Size 8.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
8e0fa7ea06e6929446a7805e28780038353a75067a26a4f79df97e886c982ca7
BLAKE2b-256 checksum
How to use checksums
cdbb0750b6253968c97646a5da67d203fa219e2fe1be3ace5e7615a29544e4b9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via pdm/2.23.0 CPython/3.13.2 Linux/6.8.0-1021-azure

Release history Release notifications | RSS feed

This release

2.4.0 This release

2 release files

2.3.1

2 release files

2.3.0

2 release files

2.2.0

2 release files

2.1.0

2 release files

2.0.7

2 release files

2.0.6

1 release file

2.0.5

1 release file

2.0.4

1 release file

2.0.3

1 release file

2.0.1

1 release file

2.0.0

1 release file

1.1.1

1 release file

1.1.0

1 release file

1.0.0

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page