--- id: pymemcache version: "4.0.0" license: Apache License 2.0 license_treatment: permissive maintenance: aging --- # pymemcache — A comprehensive, fast, pure Python memcached client License: permissive · Maintenance: aging · Downloads: 3.0M/mo ## What it is and what it does pymemcache is a pure-Python client library for memcached that implements the complete memcached text protocol. It provides flexible connection options (TCP over IPv4/IPv6 or UNIX sockets), configurable socket timeouts, and access to memcached's noreply flag for write optimization. The library includes modular serialization and deserialization, optional error-as-cache-miss handling, and supports both single-client and pooled/hashed cluster patterns. Because it is pure Python with no compiled dependencies, it integrates well with async frameworks like gevent. It is maintained by Pinterest and used in production at scale. The latest version (4.0.0) dropped Python 2 and 3.6 support, added type hints, and introduced pluggable compression serialization. Use it for: - Cache layer for web applications using Django 3.2+ (built-in backend) or other frameworks needing distributed caching. - Cluster-aware caching with HashClient for consistent hashing across multiple memcached nodes. - Async-compatible caching in gevent-based applications where C extensions are not viable. - High-throughput write scenarios using noreply mode to reduce round-trip latency. - Custom serialization workflows via flexible serde interface for domain-specific data types. ## Worth the install? AI-flagged interpretation of the facts above — verify before relying. A pure-Python memcached client implementing the complete text protocol with support for TCP (IPv4/IPv6) and UNIX sockets, configurable timeouts, and optional noreply mode for faster writes. Yes, with conditions. Install if you need a pure-Python memcached client for Django 3.2+, gevent integration, or custom serialization. The library is stable and widely used, but maintenance is aging (last release 2022-10-17). Suitable for production use; verify that your Python version is 3.7+ and that you have memcached infrastructure in place. ## Install pip install pymemcache uv add pymemcache poetry add pymemcache ## Installing pymemcache Before you install: Low friction: pure Python wheel with no runtime dependencies. Aging maintenance status—last release was 2022-10-17, though the repository remains active with recent commits and no archived status. License in practice: Apache License 2.0 (permissive) allows commercial use, modification, and distribution with minimal restrictions, making it suitable for most projects. Quickstart: pip install pymemcache from pymemcache.client.base import Client client = Client(('localhost', 'port')) client.set(b'key', b'value') result = client.get(b'key') Requires a running memcached server accessible at the specified host and port. Verify before relying: - Current performance characteristics relative to other pure-Python memcached clients in modern workloads. - Extent of typing coverage added in version 4.0.0 and whether it covers the full public API. - Whether pluggable compression serde (added in 4.0.0) is production-ready and documented. - Specific port number or connection defaults for typical memcached deployments. ## Package facts - License: Apache License 2.0 (permissive) - Python support: supports_current - Install friction: low - Maintenance: aging - Downloads: 3.0M/month (top 5,000 on PyPI) - Known vulnerabilities: none known ## Tags memcached client python, pure python memcache, memcached tcp socket, cache client library, memcached protocol implementation, distributed cache client, memcached connection pooling, caching, distributed-systems, pure-python [View on SkillFed](https://skillfed.io/packages/pymemcache) · [View on PyPI](https://pypi.org/project/pymemcache/)