LevelDB的Python开发包 py-leveldb
openkk
13年前
<p>py-leveldb 是 Google 的 K/V 数据库 LevelDB 的 Python 客户端开发包。</p> <p>示例代码:</p> <pre class="brush:python; toolbar: true; auto-links: false;">import leveldb db = leveldb.LevelDB('./db') # single put db.Put('hello', 'world') print db.Get('hello') # single delete db.Delete('hello') print db.Get('hello') # multiple put/delete applied atomically, and committed to disk batch = leveldb.WriteBatch() batch.Put('hello', 'world') batch.Put('hello again', 'world') batch.Delete('hello') db.Write(batch, sync = True)</pre> <p><strong>项目主页:</strong><a href="http://www.open-open.com/lib/view/home/1322744912640" target="_blank">http://www.open-open.com/lib/view/home/1322744912640</a></p> <p></p>