LevelDB的Python開發包 py-leveldb
py-leveldb 是 Google 的 K/V 數據庫 LevelDB 的 Python 客戶端開發包。
示例代碼:
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)
本文由用戶 openkk 自行上傳分享,僅供網友學習交流。所有權歸原作者,若您的權利被侵害,請聯系管理員。
轉載本站原創文章,請注明出處,并保留原始鏈接、圖片水印。
本站是一個以用戶分享為主的開源技術平臺,歡迎各類分享!