📜  ppcm python (1)

📅  最后修改于: 2023-12-03 14:45:38.621000             🧑  作者: Mango

PPCM

PPCM stands for Python Persistent Cache Manager. It is a lightweight cache manager for Python applications.

Installation
pip install ppcm
Getting started
Creating a persistent cache
from ppcm import CacheManager

cache = CacheManager()
Adding data to the cache
cache.set("key", "value")
Retrieving data from the cache
value = cache.get("key")
Deleting data from the cache
cache.delete("key")
Expiring data in the cache
cache.set("key", "value", ttl=60) #data in the cache will expire after 60 seconds
Checking if data exists in the cache
if cache.exists("key"):
    value = cache.get("key")
else:
    # do something else
Clearing the cache
cache.clear()
Conclusion

PPCM is a simple and efficient cache manager for Python applications. It can be used to cache data that does not change frequently and can greatly improve the performance of an application.