Skip to main content

A pure python module to access memcached via its binary protocol with SASL auth support

Project description

A pure python module (thread safe) to access memcached via it’s binary with SASL auth support.

The main purpose of this module it to be able to communicate with memcached using binary protocol and support authentication, so it can work with Heroku for example.

Latest compiled docs on Read The Docs here.

Installing

Use pip or easy_install.

pip install python-binary-memcached

Using

import bmemcached
client = bmemcached.Client(('127.0.0.1:11211', ), 'user',
                            'password')
client.set('key', 'value')
print(client.get('key'))

Using it with distributed keys

import bmemcached
client = bmemcached.DistributedClient(
    ('127.0.0.1:11211', ), 'user', 'password'
)
client.set('key', 'value')
print(client.get('key'))

Testing

python-binary-memcached unit tests are found in the test/ directory and are designed to be run using pytest. pytest will discover the tests automatically, so all you have to do is:

$ pytest
...
170 passed in 4.43 seconds

This runs the tests with the default Python interpreter.

You can also verify that the tests pass on other supported Python interpreters. For this we use tox, which will automatically create a virtualenv for each supported Python version and run the tests. For example:

$ tox
...
py27: commands succeeded
ERROR:  py34: InterpreterNotFound: python3.4
py35: commands succeeded
py36: commands succeeded
py37: commands succeeded
py38: commands succeeded

You may not have all the required Python versions installed, in which case you will see one or more InterpreterNotFound errors.

Using with Django

If you want to use it with Django, go to django-bmemcached to get a Django backend.

Tests Status

https://travis-ci.org/jaysonsantos/python-binary-memcached.png?branch=master

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

python_binary_memcached-0.31.3.tar.gz (96.2 kB view details)

Uploaded Source

Built Distribution

python_binary_memcached-0.31.3-py3-none-any.whl (17.8 kB view details)

Uploaded Python 3

File details

Details for the file python_binary_memcached-0.31.3.tar.gz.

File metadata

File hashes

Hashes for python_binary_memcached-0.31.3.tar.gz
Algorithm Hash digest
SHA256 aa7c7e1a8ef27a3e89f5f1823e04c58d891ef824ce8ca26ba683be5460f17c0a
MD5 855fdcc5b58373c895f24bc13e1ea17f
BLAKE2b-256 cdcbf1a89ce69287ed049d4b7d81a7618be9b689f9f0e51a6a8fa8e22102b01c

See more details on using hashes here.

File details

Details for the file python_binary_memcached-0.31.3-py3-none-any.whl.

File metadata

File hashes

Hashes for python_binary_memcached-0.31.3-py3-none-any.whl
Algorithm Hash digest
SHA256 e173091db6d2d7d244218ad2732edb4b99988de0894cb544d7b94dbedf2ca416
MD5 259701b39c35ba0b96a0b87ba7485b1b
BLAKE2b-256 889745e0c7bd2ed4f7ff1e5148c2345a276d7b2a9649c324c80def5e5fa29957

See more details on using hashes here.

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