pylibmc
Quick and small memcached client for Python
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 pylibmcuv
uv add pylibmcpoetry
poetry add pylibmcInstalling 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
Tags
More Database packages
psycopg2-binary is a PostgreSQL database…
copyleft · top 1,000 on PyPI
redisPython client library for connecting to and…
permissive · top 1,000 on PyPI
ydbYDB Python SDK is the official client library…
permissive · top 1,000 on PyPI
snowflake-connector-pythonConnects Python applications to Snowflake data…
permissive · top 1,000 on PyPI
sqlparsesqlparse tokenizes SQL text into a tree of…
permissive · top 1,000 on PyPI
dbt-adaptersProvides base adapter protocols and shared…
permissive · top 1,000 on PyPI
pymemcacheA pure-Python memcached client implementing the…
permissive · top 5,000 on PyPI
python-memcachedPure Python client library for connecting to…
permissive · top 5,000 on PyPI
cachelibCacheLib provides a unified API for interacting…
permissive · top 5,000 on PyPI
aiocacheProvides asyncio-compatible caching with…
unclear · top 5,000 on PyPI
diskcacheDiskCache provides a pure-Python disk-backed…
permissive · top 1,000 on PyPI
aiomcacheAsyncio-based memcached client providing…
permissive · top 15,000 on PyPI
diskcache-weaveDisk-backed cache library that stores key-value…
permissive · top 15,000 on PyPI
google-cloud-memcacheA Python client library for creating and…
permissive · top 1,000 on PyPI
BeakerBeaker provides session management and caching…
permissive · top 15,000 on PyPI