Registry /
database / python-binary-memcached
A pure Python module for accessing Memcached servers using the binary protocol, including support for SASL authentication and TLS. The current version is 0.31.4, with releases occurring periodically to add features and improvements.
Install & Compatibility
Where this runs
tested against v0.32.0 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
muslpy 3.10–3.920 runs
installs and imports cleanly · install 0.0s · import 0.064s · 18.2MB
glibcpy 3.10–3.920 runs
installs and imports cleanly · install 1.6s · import 0.060s · 19MB
16MB installed
● package 16MB
Code
Verified usage
Verified import paths — ran on the pinned version, not inferred.
The primary client for interacting with a single or failover Memcached setup.
from bmemcached import Client
A client for distributing keys across multiple Memcached servers using consistent hashing.
from bmemcached import DistributedClient
Initializes a `bmemcached.Client` instance, sets a string value, retrieves it, and then deletes it. Ensure a Memcached server is running at `127.0.0.1:11211`.
import bmemcached
import os
# Configure client with Memcached server address, optional username, and password
# Use environment variables for sensitive information
servers = ['127.0.0.1:11211']
username = os.environ.get('MEMCACHED_USER', '')
password = os.environ.get('MEMCACHED_PASSWORD', '')
mc = bmemcached.Client(servers, username, password)
# Set a key-value pair
mc.set('my_key', 'Hello, Memcached!')
print(f"Set 'my_key': {mc.get('my_key')}")
# Get a key-value pair
value = mc.get('my_key')
if value:
print(f"Retrieved 'my_key': {value.decode('utf-8')}")
else:
print("'my_key' not found")
# Delete a key
mc.delete('my_key')
print(f"Deleted 'my_key'. Now 'my_key' is: {mc.get('my_key')}")
Upgrade
Version history
Breaking-change detection hasn't run for this library yet.
Audit
Security & dependencies
CVE tracking and dependency tree are planned for a later release.