Skip to main content

Memory and disk cache for functions

Project description

Not again!

Memoize any function with this lightweight decorator, even across runs. It stores results in memory and disk.

Get it.

pip install notagain

Use it.

from notagain import memoize

@memoize()
def expensive_function(arg, kwarg=None):
  # i.e. some boring query
  return arg

Control it.

@memoize(cache_dir='tmp', memory_cache=True, disk_cache=True)

You can change the pickles path. You can deactivate memory and/or disk cache.

About the name

https://www.youtube.com/watch?v=SOBNO4gl_yM

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

notagain-0.1.tar.gz (3.7 kB view hashes)

Uploaded Source

Built Distribution

notagain-0.1-py2.py3-none-any.whl (3.1 kB view hashes)

Uploaded Python 2 Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page