Skip to content

Latest commit

 

History

16 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Simple Persistent Cache

Build Status Python GitHub CodeFactor

pcache is simple Python 3 implementation of persistent cache.

Installation

To install pcache, simply run

pip install pcache

Usage

Adding a key

>>> from pcache import PersistentCache
>>> cache = PersistentCache(filename="cachefile")
>>> cache["objId"] = "7sdjhds8"
>>> cache["objId"]
'7sdjhds8'

Cache Expiry

>>> cache.expire("objId", ttl=30) # Expire key in 30 seconds
>>> import time
>>> time.sleep(35)
>>> print(cache["objId"])
None

About

A simple implementation of persistent cache

Topics

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Used by

Contributors

Languages