Skip to main content

Yet another in-memory caching package

Project description

Pypi Version Documentation Status Coveralls Status

Yet another in-memory caching package

Features

  • Memoization

  • Selective caching based on decorators

  • Mutli-threaded support

  • Optional garbage collection thread

  • Optional time-based cache expiration

Quick Start

from __future__ import print_function
import time
from yamicache import Cache
c = Cache()
class MyApp(object):
    @c.cached()
    def long_op(self):
            time.sleep(30)
            return 1

app = MyApp()
t_start = time.time()
assert app.long_op() == 1  # takes 30s
assert app.long_op() == 1  # takes 0s
assert app.long_op() == 1  # takes 0s
assert 1 < (time.time() - t_start) < 31

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

yamicache-0.7.3.tar.gz (7.2 kB view hashes)

Uploaded Source

Built Distribution

yamicache-0.7.3-py3-none-any.whl (8.3 kB view hashes)

Uploaded 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