Skip to content

Commit 905a6bc

Browse files
committed
增加 Plyvel
1 parent ec4d2d8 commit 905a6bc

File tree

1 file changed

+19
-2
lines changed

1 file changed

+19
-2
lines changed

libs/python.wiki

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1076,15 +1076,32 @@ Home:[https://github.com/andymccurdy/redis-py]
10761076

10771077
操作 Redis 的第三方 Python 客户端。
10781078

1079-
代码示例——简单的 set/get
1079+
代码示例——简单的存取操作
10801080
<source lang="python">
10811081
import redis
10821082
r = redis.StrictRedis(host="localhost", port=6379, db=0)
10831083
r.set("foo", "bar")
10841084
print(r.get("foo"))
10851085
</source>
10861086

1087-
=== 6.2.8 Berkeley DB ===
1087+
=== 6.2.8 LevelDB ===
1088+
1089+
<h4>Plyvel</h4>
1090+
1091+
Home:[https://github.com/wbolster/plyvel]
1092+
1093+
操作 LevelDB 的 Python 库,速度快,同时兼容 Python2 和 Python3。
1094+
1095+
代码示例——简单的存取操作
1096+
<source lang="python">
1097+
import plyvel
1098+
db = plyvel.DB("/tmp/testdb/", create_if_missing=True)
1099+
db.put(b"key", b"value")
1100+
print(db.get(b"key"))
1101+
db.close()
1102+
</source>
1103+
1104+
=== 6.2.9 Berkeley DB ===
10881105

10891106
<h4>PyBSDDB</h4>
10901107

0 commit comments

Comments
 (0)