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
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file python_binary_memcached-0.31.3.tar.gz
.
File metadata
- Download URL: python_binary_memcached-0.31.3.tar.gz
- Upload date:
- Size: 96.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.0 CPython/3.12.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | aa7c7e1a8ef27a3e89f5f1823e04c58d891ef824ce8ca26ba683be5460f17c0a |
|
MD5 | 855fdcc5b58373c895f24bc13e1ea17f |
|
BLAKE2b-256 | cdcbf1a89ce69287ed049d4b7d81a7618be9b689f9f0e51a6a8fa8e22102b01c |
File details
Details for the file python_binary_memcached-0.31.3-py3-none-any.whl
.
File metadata
- Download URL: python_binary_memcached-0.31.3-py3-none-any.whl
- Upload date:
- Size: 17.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.0 CPython/3.12.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | e173091db6d2d7d244218ad2732edb4b99988de0894cb544d7b94dbedf2ca416 |
|
MD5 | 259701b39c35ba0b96a0b87ba7485b1b |
|
BLAKE2b-256 | 889745e0c7bd2ed4f7ff1e5148c2345a276d7b2a9649c324c80def5e5fa29957 |