This is a pre-production deployment of Warehouse. Changes made here affect the production instance of PyPI (pypi.python.org).
Help us improve Python packaging - Donate today!
Project Description

Memcache is a general-purpose distributed memory caching system that was originally developed by Danga Interactive for LiveJournal, but is now used by many other sites.

This plugin simplifies the use of memcache in your Bottle applications. Once installed, all you have to do is to add a mc keyword argument (configurable) to route callbacks that need a memcache connection.

Installation

Install with one of the following commands:

$ pip install bottle-memcache
$ easy_install bottle-memcache

or download the latest version from github:

$ git clone git://github.com/bottlepy/bottle-extras.git
$ cd bottle-extras/memcache
$ python setup.py install

Usage

Once installed to an application, the plugin passes an open memcache.Client instance to all routes that require an mc keyword argument:

import bottle
import bottle.ext.memcache

app = bottle.Bottle()
plugin = bottle.ext.memcache.MemcachePlugin(servers=['localhost:11211'])
app.install(plugin)

@app.route('/show/:item')
def show(item, mc):
    val = mc.get('item_key')
    if not val:
        mc.set('item_key', item)
        val = mc.get('item_key')
    return template('showitem', item=val)

Routes that do not expect an mc keyword argument are not affected.

Configuration

The following configuration options exist for the plugin class:

  • servers: A list of server:port items to connect to (default: [‘localhost:11211’,])
  • timeout: The timeout value in seconds when connecting (default: 3)
  • keyword: The keyword argument name that triggers the plugin (default: ‘mc’).
Release History

Release History

0.2.1

This version

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

0.2

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

0.1

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

Download Files

Download Files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

File Name & Checksum SHA256 Checksum Help Version File Type Upload Date
bottle-memcache-0.2.1.tar.gz (2.6 kB) Copy SHA256 Checksum SHA256 Source Aug 29, 2013

Supported By

WebFaction WebFaction Technical Writing Elastic Elastic Search Pingdom Pingdom Monitoring Dyn Dyn DNS Sentry Sentry Error Logging CloudAMQP CloudAMQP RabbitMQ Heroku Heroku PaaS Kabu Creative Kabu Creative UX & Design Fastly Fastly CDN DigiCert DigiCert EV Certificate Rackspace Rackspace Cloud Servers DreamHost DreamHost Log Hosting