pyappcache

A library for application-level caching


Keywords
cache, library
License
GPL-3.0
Install
pip install pyappcache==0.10.0

Documentation

pyappcache

Pyappcache is a library to make it easier to use application-level caching in Python.

  • Allows putting arbitrary Python objects into the cache
  • Uses PEP484 type hints to help you typecheck cache return values
  • Supports Memcache, Redis and SQLite
  • Supports working as a "read-through" and "write-through" cache
  • Native support for key "namespacing"
  • Provides a few handy extras

A simple example

How it compares to alternatives

Using the redis/memcache/sqlite client directly

  • Explicit key objects allow for type inference and encapsulation of keying
  • Keys are prefix to help prevent collisions
  • Optional, pluggable, compression
  • Hopefully the overhead is small (not yet tested!)
  • Portable between redis/memcache/sqlite, etc

dogpile.cache

  • Explicit key objects allow for type inference and encapsulation of keying
  • dogpile.cache provides locking, pyappcache does not
  • Reduced temptation to use the problematic decorator pattern
    • This often causes import order problems as you need to have your cache at import time
  • Pyappache doesn't provide DBM/file backends, SQLite instead