Skip to content

pallabpain/pcache

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

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

License

Stars

Watchers

Forks

Releases

No releases published

Languages