RETIRED, further work has moved to Debian project infrastructure
Go to file
Nicholas Charriere a0f9030733 Merge pull request #158 from pinterest/revert
Reverse backwards compatible change
2017-06-02 12:09:54 -07:00
docs removed apidoc directory from repo 2017-06-02 00:15:21 -05:00
pymemcache Use only the highest, premium quality picklers available at runtime. 2017-05-31 19:17:16 -07:00
.gitignore add apidoc to .gitignore 2017-05-31 05:35:58 -05:00
.travis.yml Update ChangeLog.rst 2016-12-02 13:54:28 -08:00
ChangeLog.rst Changelog changes for 1.4.3 2017-04-04 13:08:29 -07:00
LICENSE.txt Increasing version to 1.0, adding various package stuff 2013-02-19 16:36:03 -08:00
MANIFEST.in Include changelog in the manifest 2015-07-16 12:39:43 -07:00
README.rst Simplify README for running tests. Only tox 2017-04-23 19:01:05 -07:00
docs-requirements.txt Enforce version for sphinx 2016-08-03 13:44:51 -07:00
setup.cfg Exclude well-known non-code paths from flake8 2017-05-05 09:36:22 -07:00
setup.py Exclude well-known non-code paths from flake8 2017-05-05 09:36:22 -07:00
test-requirements.txt Fix an issue in Travis where the build breaks because of a gevent bump 2017-02-17 09:56:01 -08:00
tox.ini Remove docs from being run when you're running tests 2017-04-23 10:29:35 -07:00

README.rst

pymemcache

image

image

Master Documentation Status

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, modular and simple approach to serialization and deserialization.
  • The (optional) ability to treat network and memcached errors as cache misses.

Installing pymemcache

Install from pip:

pip install pymemcache

For development, clone from github and run the tests:

git clone https://github.com/pinterest/pymemcache.git
cd pymemcache

Run the tests (make sure you have a local memcached server running):

tox

Usage

See the documentation here: https://pymemcache.readthedocs.io/en/latest/

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. It also isn't pure Python, so using it with libraries like gevent is out of the question, and its dependency on libmemcached poses challenges (e.g., it must be built against the same version of libmemcached that it will use at runtime).

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.

External Links

The memcached text protocol reference page:

https://github.com/memcached/memcached/blob/master/doc/protocol.txt

The python-memcached library (another pure-Python library):

https://github.com/linsomniac/python-memcached

Mixpanel's Blog post about their memcached client for Python:

http://code.mixpanel.com/2012/07/16/we-went-down-so-we-wrote-a-better-pure-python-memcache-client/

Mixpanel's pure Python memcached client:

https://github.com/mixpanel/memcache_client

Credits