用于动态编程的数据库缓存
db_cache的Python项目详细描述
数据库缓存
用于动态编程的数据库缓存
- 自由软件:麻省理工学院许可证
- 文档:https://db-cache.readthedocs.io。
简介
指南
tl;dr
importdb_cache# Instantiate cache object that connects to PostgreSQL with provided credentialcache=db_cache.Cache(database="db_name",user="admin",password="12345",host="localhost")# Create decorater that cache function result using provided table name@cache.use_table("some_table_name")defsome_expensive_function(large_int):prime1,prime2=factoring(large_int)return(prime1,prime2)# Return cached value if possible, otherwise compute and cache result.some_expensive_function(121103)
功能
- 待办事项
学分
这个包是用Cookiecutter和audreyr/cookiecutter-pypackage项目模板创建的。
历史记录
0.1.0(2016-11-04)
- pypi上的第一个版本。