Skip to main content

A comprehensive, fast, pure Python memcached client

Project description

pymemcache

[![Build Status](https://travis-ci.org/pinterest/pymemcache.png)](https://travis-ci.org/pinterest/pymemcache)

A comprehensive, fast, pure-Python memcached client.

pymemcache supports the following features:

  • Complete implementation of the memcached text protocol.

  • Configurable timeouts for socket connect and send/recv calls.

  • Access to the “noreply” flag, which can significantly increase the speed of writes.

  • Flexible, simple approach to serialization and deserialization.

  • The (optional) ability to treat network and memcached errors as cache misses.

Installing pymemcache

You can install pymemcache manually, with Nose tests, by doing the following:

git clone https://github.com/pinterest/pymemcache.git cd pymemcache python setup.py nosetests sudo python setup.py install

You can also use pip:

sudo pip install https://github.com/pinterest/pymemcache.git

Usage

See the module documentation in pymemcache.client for details.

Comparison with Other Libraries

pylibmc

The pylibmc library is a wrapper around libmemcached, implemented in C. It is fast, implements consistent hashing, the full memcached protocol and timeouts. It does not provide access to the “noreply” flag, and it doesn’t provide a built-in API for serialization and deserialization. It also isn’t pure Python, so using it with libraries like gevent is out of the question.

Python-memcache

The python-memcache library implements the entire memcached text protocol, has a single timeout for all socket calls and has a flexible approach to serialization and deserialization. It is also written entirely in Python, so it works well with libraries like gevent. However, it is tied to using thread locals, doesn’t implement “noreply”, can’t treat errors as cache misses and is slower than both pylibmc and pymemcache. It is also tied to a specific method for handling clusters of memcached servers.

memcache_client

The team at mixpanel put together a pure Python memcached client as well. It has more fine grained support for socket timeouts, only connects to a single host. However, it doesn’t support most of the memcached API (just get, set, delete and stats), doesn’t support “noreply”, has no serialization or deserialization support and can’t treat errors as cache misses.

Credits

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pymemcache-1.2.1.tar.gz (17.8 kB view details)

Uploaded Source

Built Distributions

pymemcache-1.2.1.macosx-10.9-intel.tar.gz (36.3 kB view details)

Uploaded Source

pymemcache-1.2.1-py2.py3-none-any.whl (22.8 kB view details)

Uploaded Python 2 Python 3

File details

Details for the file pymemcache-1.2.1.tar.gz.

File metadata

  • Download URL: pymemcache-1.2.1.tar.gz
  • Upload date:
  • Size: 17.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for pymemcache-1.2.1.tar.gz
Algorithm Hash digest
SHA256 f3e05af2fe534ed62e697d1fcd7e6a3dc103109cf84ec8f8dda195767e188f19
MD5 ac3480e54820919d00980e38900a381e
BLAKE2b-256 a890c7e4d77b7232a3191a8ff1fa5c4218db937da27194e3d4534d6f7a1d7d52

See more details on using hashes here.

Provenance

File details

Details for the file pymemcache-1.2.1.macosx-10.9-intel.tar.gz.

File metadata

File hashes

Hashes for pymemcache-1.2.1.macosx-10.9-intel.tar.gz
Algorithm Hash digest
SHA256 a3d24180e733d1ad0769cde21c1ebe8f19c6dfd14796994b96bce7e6cf10a38a
MD5 5c666fdc78a3b9c8f12b12459fd1f9b5
BLAKE2b-256 e6c6265faa192341829bc540a1b8a1eb0e71cd5edcae007520981455013a5f04

See more details on using hashes here.

Provenance

File details

Details for the file pymemcache-1.2.1-py2.py3-none-any.whl.

File metadata

File hashes

Hashes for pymemcache-1.2.1-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 5c096f904395addb8fcadd4eaf2dda14c422e9ce22b0ccad9259f68861306150
MD5 0c6f810f26c621cf16d0824178105e6a
BLAKE2b-256 ad0fc0aa2bfcbd343df07b27a2fea0e29af76e034c531861064b94d8bc7af605

See more details on using hashes here.

Provenance

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page