Skip to main content

Enhance Python memcached client with a dictionary class

Project description

# 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/).

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

mcdict-1.03.tar.gz (4.2 kB view details)

Uploaded Source

File details

Details for the file mcdict-1.03.tar.gz.

File metadata

  • Download URL: mcdict-1.03.tar.gz
  • Upload date:
  • Size: 4.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for mcdict-1.03.tar.gz
Algorithm Hash digest
SHA256 2f061e6ebb213971a2712967ff0057f95559de7ecb660ef412fb9b783c7f1eab
MD5 fc32a920f7e012b7079fae302043d5fa
BLAKE2b-256 e153e1c4775a866ea1fa407e3cc5ec9532f0edcd616c01570caa31bbdd848149

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