skillfed

python-binary-memcached

A pure python module to access memcached via its binary protocol with SASL auth support

python-binary-memcached v0.32.0 154.8K downloads/30d#10,845 on PyPI166
Permissive license Active released

What it is and what it does

python-binary-memcached is a pure Python client for memcached that communicates using the binary protocol rather than the text protocol. It supports SASL authentication, making it suitable for hosted memcached services like Heroku that require credentials. The library is thread-safe and offers both a standard client for single-server or replicated setups and a DistributedClient that uses consistent hashing to distribute keys across multiple memcached servers.

The package depends on six and uhashring for consistent hashing when using the distributed client. It has been actively maintained since 2011, with recent updates adding TLS support and protocol argument exposure. The library is classified as Beta and supports Python 3.8, 3.9, 3.10, 3.11, 3.12.

Use it for:

  • Connect to Heroku memcached or other SASL-authenticated memcached services from Python applications.
  • Distribute cached data across multiple memcached servers using consistent hashing to minimize cache invalidation on server changes.
  • Secure memcached connections with TLS encryption in production environments.
  • Replace text-protocol memcached clients when binary protocol features or authentication are required.
  • Build thread-safe caching layers in multi-threaded Python applications.

Worth the install?

AI-flagged interpretation of the facts on this page — verify before relying

A pure Python client library for accessing memcached using the binary protocol with SASL authentication support, including distributed key hashing and TLS encryption.

Yes. The package is actively maintained, has no known vulnerabilities, installs with minimal friction, and solves a specific problem—binary protocol access with authentication—that text-protocol clients do not. It is suitable for production use, particularly when integrating with hosted memcached services that require SASL authentication.

Install

python-binary-memcached on PyPI

pip

pip install python-binary-memcached

uv

uv add python-binary-memcached

poetry

poetry add python-binary-memcached

Installing python-binary-memcached

Before you install

Low friction: pure Python wheel with only two runtime dependencies (six and uhashring). Active maintenance with a recent release on 2026-04-28 and continuous repository activity.

License in practice

Permissive license allows commercial and private use without restriction or attribution requirement.

Quickstart

pip install python-binary-memcached

import bmemcached
client = bmemcached.Client(('127.0.0.1:11211',), 'user', 'password')
client.set('key', 'value')
print(client.get('key'))

Requires a running memcached server accessible at the specified host and port.

Verify before relying

  • Whether the package supports Python versions beyond 3.8, 3.9, 3.10, 3.11, 3.12.
  • Performance characteristics compared to other memcached clients for high-throughput scenarios.
  • Thread safety guarantees and behavior under concurrent access patterns.

Package facts

License not declared (permissive)
Python support not specified
Install friction low — pure-Python wheel
Runtime dependencies 2 — six, uhashring
Maintenance actively maintained — 108 days since the last release
Last repo commit
First released
Downloads 154,757/month — #10,845 on PyPI (30-day window, as of 2026-08-14)
Known vulnerabilities none known (OSV.dev, checked 2026-08-14)

Evidence: python_binary_memcached-0.32.0-py3-none-any.whl

Development Status :: 4 - BetaLicense :: OSI Approved :: MIT LicenseOperating System :: OS IndependentProgramming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.8Programming Language :: Python :: 3.9

Tags

memcached binary protocol clientmemcached sasl authenticationdistributed memcached hashingpython memcached tlsmemcached consistent hashingthread-safe memcached clientheroku memcached python
cachingmemcacheddistributed-systems

More Database packages