A minimal Python library and CLI client for Memcached.
- Simple CLI: set/get and additional storage verbs (add, replace, append, prepend)
- Defaults to host=localhost and port=11211
- Works as a module runner or installed console script
pmcc
- Python 3.10+
- A running Memcached server
python -m venv .venv
source .venv/bin/activate
pip install -U pip
pip install -e .Run as a module without installing:
python -m pymemcacheconsole.cli -? # help
python -m pymemcacheconsole.cli -H localhost -p 11211 set mykey myvalue
python -m pymemcacheconsole.cli --host localhost --port 11211 get mykeyAfter installing, use the pmcc command:
pmcc -?
pmcc -H your.memcached.host -p 12121 set testkey testvalue
pmcc -H your.memcached.host -p 12121 get testkey- Keys with a trailing slash are trimmed automatically (e.g.,
testkey/->testkey). - For storage commands, the client prints the raw server response (
STORED,NOT_STORED, etc.). - For retrieval, values are printed as
key => valueor(nil)if not found.
Run tests:
source .venv/bin/activate
pytest -qpymemcacheconsole/
__init__.py
cli.py
client.py
protocol.py
models.py
tests/
test_protocol.py
test_client.py
test_cli.py
MIT