This is a pre-production deployment of Warehouse, however changes made here WILL affect the production instance of PyPI.
Latest Version Dependencies status unknown Test status unknown Test coverage unknown
Project Description

INSTALLATION

>>> pip install dummycache

USAGE

>>> from dummycache import Cache
>>> c = Cache()

The basic interface is set(key, value, timeout=None) and get(key, default=None):

>>> c.set('key_a', 'Good morning, today!', 60)    # Set value in cache for 60 seconds
>>> c.get('key_a')
'Good morning, today!'

Wait 60 seconds:

>>> c.get('key_a')
None

If timeout is not provided, the value is saved forever or until it is overridden or explicitly deleted:

>>> c.set('key_b', 'Good afternoon, forever!')    # Set value in cache forever

If timeout is zero or negative, the value is not saved. The value previously saved with the same key will also be deleted:

>>> c.set('key_b', 'Good bye', 0)    # The value is not set
>>> c.get('key_b')
None

cache.get() can take a default argument. This specifies which value to return if the object doesn’t exist in the cache:

>>> c.get('key_a', 'has expired')
'has expired'

To add a key only if it doesn’t already exist, use the add() method. It takes the same parameters as set(), but it will not attempt to update the cache if the key specified is already present:

>>> c.set('key_c', 'Initial value')
>>> c.add('key_c', 'New value')
>>> c.get('key_c')
'Initial value'

If you need to know whether add() stored a value in the cache, you can check the return value. It will return True if the value was stored, False otherwise.

You can delete keys explicitly with delete(). This is an easy way of clearing the cache for a particular object:

>>> c.delete('key_c')
Finally, if you want to delete all the keys in the cache, use clear(). Be careful with this; clear() will remove
everything from the cache, not just the keys set by your application.
>>> c.clear()
Release History

Release History

0.0.2

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.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

TODO: Brief introduction on what you do with files - including link to relevant help section.

File Name & Checksum SHA256 Checksum Help Version File Type Upload Date
dummycache-0.0.2.tar.gz (3.8 kB) Copy SHA256 Checksum SHA256 Source Apr 8, 2012

Supported By

WebFaction WebFaction Technical Writing Elastic Elastic Search Pingdom Pingdom Monitoring Dyn Dyn DNS HPE HPE Development 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