Skip to main content
A Python function wrapper to cache method results using memcache

Usage:

from memcache_wrapper import Memcached
from mockcache import Client

mc_client = Client()

@Memcached('/myprefix', mc_client)
def myfunc(args):
...

or

mc = Memcached('/myprefix', mc_client)
cached_myfunc = mc.wrap(myfunc)

For short,
cached_myfunc = Memcached('/myprefix', mc_client).wrap(myfunc)

See more examples at test/test_memcache_wrapper.py

Parameters:

prefix: used as memached's key prefix

mc_client: memcache client instance, such as python-memcached or mockcache

ttl: time to live in memcache, default: 10

bypass_cache: if True, bypass cache and save the result

cache_negative: if False, do not cache negative result, such as [], {}, and None. Otherwise, it will cache everything.

Metadata

Release files for memcache_wrapper 1.0.4

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

Source distribution (sdist)

Source distribution for memcache_wrapper 1.0.4
File Size Uploaded
memcache_wrapper-1.0.4.tar.gz 2.8 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for memcache_wrapper 1.0.4
File Interpreter ABI Platform
memcache_wrapper-1.0.4-py2-none-any.whl Python 2 none any Details

Total release size: 6.8 kB

Release files / memcache_wrapper-1.0.4.tar.gz

Download URL memcache_wrapper-1.0.4.tar.gz
Size 2.8 kB
Tags Source
SHA-256 checksum
How to use checksums
5258635e038009793b1cb649c477fe0accece3084bcee2a3910ec841f1ee564b
BLAKE2b-256 checksum
How to use checksums
b889586284c85a9dd09eff067e1e838cd81f694a072705d4a0b91f05eda3c478
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release files / memcache_wrapper-1.0.4-py2-none-any.whl

Download URL memcache_wrapper-1.0.4-py2-none-any.whl
Size 4.0 kB
Tags Python 2
SHA-256 checksum
How to use checksums
dd556d879eba3d07382c95356fb01c3e7d1acea38de02f7ef17c8d3bc5c26cf7
BLAKE2b-256 checksum
How to use checksums
08aee8265ef4cffe2d146993c8c00670e93f122198065d9255aede0d69c41dce
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release history Release notifications | RSS feed

This release

1.0.4 This release

2 release files

1.0.3

2 release files

1.0.2

2 release files

1.0.1

2 release files

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