mcdict 1.03
Enhance Python memcached client with a dictionary class
# mcdict
Python class to access a memcache as if it was a dict. This implementation includes the keys() method. All the memcache limitations are preserved, e.g. keys must be strings no longer than 250 bytes.
## Usage
Basic usage:
import mcdict mc = mcdict.MCDict() mc["mummy"] = "Olena" print mc["mummy"]
By default, it connects to localhost on port 11211. If you need to specify a host and/or port:
mc = mcdict.MCDict(mcaddress='127.0.0.1:5211')
Access the underlying memcache Client object (note second mc)
>>> mc.mc.get_stats()
{'accepting_conns': '1',
'auth_cmds': '0',
'auth_errors': '0',
... }
Retrieve a list of keys currently in use: (note that this will cause big memcaches to block until it completes and this won't provide a complete list of keys on very big memcaches)
>>> mc.keys() ['mummy', 'daddy', 'masha', ... ]
## Installation
pip install 'git+git://github.com/wavetossed/mcdict.git'
## License
mcdict is released under the [MIT license](http://creativecommons.org/licenses/MIT/).
| File | Type | Py Version | Uploaded on | Size | # downloads |
|---|---|---|---|---|---|
| mcdict-1.03.tar.gz (md5) | Source | 2011-07-31 | 4KB | 271 | |
- Author: Michael Dillon
- Home Page: https://github.com/wavetossed/mcdict
- Download URL: https://github.com/wavetossed/mcdict/tarball/master
-
Categories
- Development Status :: 4 - Beta
- Intended Audience :: Developers
- License :: OSI Approved :: MIT License
- Operating System :: OS Independent
- Programming Language :: Python
- Programming Language :: Python :: 2
- Topic :: Database :: Front-Ends
- Topic :: Internet
- Topic :: Software Development :: Libraries :: Python Modules
- Topic :: System :: Distributed Computing
- Package Index Owner: wavetossed
- DOAP record: mcdict-1.03.xml
