单个文件数据库存储键值对。
kiwilite的Python项目详细描述
- 安装:
- pip安装kiwilite
- 用法:
导入kiwilite
以kiwilite.open('<;指向数据库文件的路径>;')作为存储:
# Set map data of key and value and save storage file. storage.Set({‘<key>’: ‘<value>’})
# Get value bytes of key. <value> = storage.Get(‘<key>’)
# Log: a list of timestones. [<list>, <of>, <timestones>] = storage.Log(<start-timestamp>, <end-timestamp>)
# Rollback to the last timestone before timestamp, # and clear all data after timestamp. storage.Rollback(<timestamp>)
# Lighten to the first timestone after timestamp, # and clear all invalid data before timestamp. # Data will not lose, but cannot rollback before timestamp. storage.Lighten(<timestamp>)