A simple implementation of a namespaced memcached client
Project description
- Contact:
- np at akei com
Abstract
NSMemcached is simple yet efficient Python implementation of a namespaced client for memcached on top of the python-memcached package.
Quick Start
Sample usage:
>>> import memcache >>> from nsmemcached.client import NamespacedClient >>> std_client = memcache.Client(['127.0.0.1:11211']) >>> ns_client = NamespacedClient(std_client) >>> ns_client.set('foo', 'bar', ns='barspace') True >>> ns_client.get('foo', ns='barspace') bar >>> ns_client.get('foo') None >>> ns_client.clear_ns('barspace') >>> ns_client.get('foo', ns='barspace') None
Yes, that simple.
Caveats
Namespace keys are stored in dedicated keys, so every time you request a namespaced item you’ll make two queries to the memcached server instead of one, so expect a tiny slowdown compared to the way of using the standard, non-namespaced memcached API.
Dependencies and Compatibility
NSMemcached requires the use of Python 2.4 or more recent.
Installing python-memcached package is required in order to use this library, as well as a working memcached server instance, obviously.
NSMemcached is fully compatible with the API of the standard python-memcached client.
License
This code is released under the terms of the MIT License.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
File details
Details for the file NSMemcached-0.2.0.tar.gz
.
File metadata
- Download URL: NSMemcached-0.2.0.tar.gz
- Upload date:
- Size: 3.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4c018d8d518297e7bb4358648dd682fd2de901d89987152b47264e244dfa96f9 |
|
MD5 | 83aaf5fb4403d8a6275b9a44165a4367 |
|
BLAKE2b-256 | 62234f0519eb417a8f8d16c7dee1e4d4e72442d864b4ed3c78ce98029e2a24fb |