python中基于磁盘的键/值存储。
disk_dict的Python项目详细描述
diskdict是硬盘上的哈希表。它允许您存储Kazillions(!)键/值对,并像python字典那样与它们交互,同时在内存中存储的键/值对永远不会超过两个。键/值对可以是任何可序列化的(可以指定序列化器和反序列化器,默认为repr和eval)。因为我们在磁盘上运行,所以所有操作的大O都依赖于主机操作系统的文件访问复杂性。
>>> from disk_dict import DiskDict >>> from numpy import array >>> dd = DiskDict('my_disk_dict') >>> a = array([[1,2],[3,4]]) >>> dd[a] = 'I was pointed to by ' + repr(a) >>> dd[a] 'I was pointed to by array([[1, 2],\n [3, 4]])' >>> del dd[a] >>> dd[a] >>>
PYPI:https://pypi.python.org/pypi?name=disk_dict&:action=display
github:https://github.com/AWNystrom/DiskDict/