skillfed

pylibmc

Quick and small memcached client for Python

pylibmc v1.6.3 460.7K downloads/30d#6,539 on PyPI492
Permissive license 3-clause BSD <https://opensource.org/licenses/bsd-license.php> AGING released

What it is and what it does

pylibmc is a C-based Python client for memcached, the distributed memory caching system. It provides low-level access to memcached servers for storing and retrieving cached data across multiple machines. The package has no runtime dependencies and compiles to native code for caching operations.

The library is designed for applications that need to share cached state across processes or machines—typical use cases include session storage, database query result caching, and temporary data sharing in web applications. Version 1.6.3 introduced improved interoperability by standardizing flag usage and storing Unicode strings as UTF-8 rather than pickled data. Installation requires either a prebuilt wheel (available for Linux and macOS) or a C compiler and memcached development headers.

Use it for:

  • Cache database query results across multiple application servers to reduce database load.
  • Store session data in memcached for shared access in horizontally scaled web applications.
  • Temporarily cache expensive computation results during request processing.
  • Share transient state between worker processes in a distributed task queue.
  • Implement rate-limiting counters or feature flags in a distributed system.

Worth the install?

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

pylibmc is a Python client for memcached, the distributed memory-caching system, implemented in C for performance.

Yes, if you need a memcached client and have a running memcached server. The C implementation provides performance benefits for caching scenarios. However, the aging maintenance status (last release 2022-08-30) means you should verify compatibility with your Python version and memcached deployment before committing to production use. No known vulnerabilities.

Install

pylibmc on PyPI

pip

pip install pylibmc

uv

uv add pylibmc

poetry

poetry add pylibmc

Installing pylibmc

Before you install

Medium install friction due to C extension compilation requirements. Package is aging (last release 2022-08-30, 1445 days prior) but repository remains active with recent commits as of 2025-04-12. Supports Python 3.6 through 3.11 with prebuilt wheels for common platforms.

License in practice

Released under 3-clause BSD, a permissive license allowing commercial and private use with minimal restrictions—suitable for most projects.

Quickstart

pip install pylibmc
import pylibmc
mc = pylibmc.Client(['localhost'])
mc.set('key', 'value')
value = mc.get('key')

Requires a running memcached server accessible at the specified host and port; C compiler and memcached development headers needed at install time on systems without prebuilt wheels.

Verify before relying

  • Whether the aging maintenance status (last release 1445 days ago) affects real-world reliability for current Python versions.
  • Performance characteristics compared to alternative memcached clients in production workloads.
  • Compatibility guarantees with memcached protocol versions beyond what the fact sheet documents.

Package facts

License 3-clause BSD <https://opensource.org/licenses/bsd-license.php> (permissive)
Python support supports the current Python release (>=3.6)
Install friction medium — platform-specific wheel
Runtime dependencies none
Maintenance aging — 1,445 days since the last release
Last repo commit
First released
Downloads 460,721/month — #6,539 on PyPI (30-day window, as of 2026-08-14)
Known vulnerabilities none known (OSV.dev, checked 2026-08-14)

Evidence: pylibmc-1.6.3-cp310-cp310-macosx_10_9_x86_64.whl; pylibmc-1.6.3-cp310-cp310-macosx_11_0_arm64.whl; pylibmc-1.6.3-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl; pylibmc-1.6.3-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl; pylibmc-1.6.3-cp311-cp311-macosx_10_9_x86_64.whl; pylibmc-1.6.3-cp311-cp311-macosx_11_0_arm64.whl; pylibmc-1.6.3-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl; pylibmc-1.6.3-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl; pylibmc-1.6.3-cp36-cp36m-macosx_10_9_x86_64.whl; pylibmc-1.6.3-cp36-cp36m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl; pylibmc-1.6.3-cp36-cp36m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl; pylibmc-1.6.3-cp37-cp37m-macosx_10_9_x86_64.whl; pylibmc-1.6.3-cp37-cp37m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl; pylibmc-1.6.3-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl; pylibmc-1.6.3-cp38-cp38-macosx_10_9_x86_64.whl; pylibmc-1.6.3-cp38-cp38-macosx_11_0_arm64.whl; pylibmc-1.6.3-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl; pylibmc-1.6.3-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl; pylibmc-1.6.3-cp39-cp39-macosx_10_9_x86_64.whl; pylibmc-1.6.3-cp39-cp39-macosx_11_0_arm64.whl

Programming Language :: PythonProgramming Language :: Python :: 3Programming Language :: Python :: 3 :: OnlyProgramming Language :: Python :: 3.10Programming Language :: Python :: 3.6Programming Language :: Python :: 3.7Programming Language :: Python :: 3.8Programming Language :: Python :: 3.9

Tags

memcached client pythondistributed cachingin-memory cache clientmemcached python bindingfast cache accessmemory cache protocolsession storage cache
cachingdistributed-systemsmemcached

More Database packages