Skip to main content

Async ready Multi Caching Library.

Project description

Async ready Multi Cache Library

codecov GitHub license PyPI - Status

A python package to use a async ready decorator for caching outputs.

Currently supported cache stores:

  • Filecache
  • Memcached

Requirements

  • memcached

On osx

brew install memcached
brew services start memcached

On Linux

sudo apt-get -y install memcached libmemcached-tools
sudo systemctl enable memcached
sudo systemctl start memcached

Installing the package

pip install mcache

Using it in your application

from mcache import filecache, DAY

@filecache(lifetime=DAY*2)
def add(x):
    return x+4 

print(add(10))

Async

import asyncio
from mcache import filecache, DAY

@filecache(lifetime=DAY*2)
async def add(x):
    return x+4 

print(asyncio.run(add(10)))

Sriram

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

mcache-1.0.0.tar.gz (5.8 kB view hashes)

Uploaded Source

Built Distribution

mcache-1.0.0-py3-none-any.whl (8.0 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