Skip to main content

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

Project description

Introduction to bmemcached

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

v0.31.2 (2022-12-14)

Fix

  • Remove setup’s.py dependency on m2r

v0.31.1 (2021-12-29)

v0.31.0 (2021-12-28)

Refactor

  • Use bytearrays for building up bytes for I/O. (#245)

Feat

  • Expose incr/decr default and time protocol arguments in client class (#243)

v0.30.1 (2020-10-11)

v0.30.0 (2020-08-18)

  • Add ability to return default value on get but breaking get’s API

  • Support an arbitrary collection of keys, not just a list

v0.30 (2020-06-10)

v0.29.0 (2020-01-29)

  • added TLS support on #211 thanks to @moisesguimaraes!

v0.28.0 (2018-10-02)

  • moved bmemcached.Client to bmemcached.ReplicantClient but keeps backward compatibility

  • added DistributedClient to distribute keys over servers using consistent hashing

v0.27.0 (2018-08-10)

0.26.1 (2017-07-18)

0.26.0 (2017-01-13)

0.25.0 (2016-12-15)

0.24.7 (2016-11-08)

0.24.2 (2014-05-27)

0.24.1 (2014-05-20)

0.24 (2014-04-28)

0.23 (2014-04-18)

v0.18 (2013-05-06)

v0.17 (2013-04-15)

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.4.tar.gz (97.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

python_binary_memcached-0.31.4-py3-none-any.whl (18.6 kB view details)

Uploaded Python 3

File details

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

File metadata

File hashes

Hashes for python_binary_memcached-0.31.4.tar.gz
Algorithm Hash digest
SHA256 f183bc67fd218c01ebc0bf4e9929a210dd5aa07fda53d5b627d0b443b76e2818
MD5 fdfd9262552a9f7c41dbad350f1f4805
BLAKE2b-256 8db7237430c8f55c807f0f7de5d3928e3318e7cda46f8cdfdfde1c56529d8ab9

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for python_binary_memcached-0.31.4-py3-none-any.whl
Algorithm Hash digest
SHA256 f7a74f212567e37520dd550f0d088b99bb4bae01034d3078135bfc16285960f9
MD5 de56747d2737caadd3061d94c0060424
BLAKE2b-256 e514558657f9d646909f9b959c05c9dfef4ecc6f66c571442aa346079500b290

See more details on using hashes here.

Supported by

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