Skip to main content

An elegant cache library for python

Project description

Build Status PyPI - Python Version PyPI - License Codecov branch


An elegant cache library for python

How to use


pip install sponge


from sponge import CacheManager

# config cache manager
manager = CacheManager({
    'default': 'redis',
    'redis': {
        'host': 'localhost',
        'port': 3306,
        'db': 0
    'memory': {}

# get cache instance
cache ='redis')

# set cache
cache.put('mykey', 'myvalue', 30) # 30 seconds
cache.get('mykey')                # myvalue

# remove cache

# cache fover
cache.fover('mykey', 1)

# increase
cache.increase('mykey')     # the value will be 2

# decrease
cache.decrease('mykey', 2)  # the value will be -1

# clear all


  • [ ] Support cache events
  • [ ] Support file driver
  • [ ] Support database driver
  • [ ] Added into awesome-python

Project details

Download files

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

Files for sponge, version 0.0.5
Filename, size File type Python version Upload date Hashes
Filename, size sponge-0.0.5.tar.gz (4.6 kB) File type Source Python version None Upload date Hashes View

Supported by

Pingdom Pingdom Monitoring Google Google Object Storage and Download Analytics Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page