import plyvel

db = plyvel.DB('./repo', create_if_missing=True)

# repo/
# |-- 000018.ldb
# |-- 000020.ldb
# |-- 000021.log
# |-- CURRENT
# |-- LOCK
# |-- LOG
# |-- LOG.old
# |-- MANIFEST-000019

db.put('name'.'n1')
db.put('name2'.'n2')
cc = db.get('name')
print(cc)
#db.delete('name2')
#cc = db.get('name2')
#print(cc)

sn = db.snapshot()
for i in sn:
  print(i)

for i in db:
  print(i)

db.close()
Copy the code