pylhb4redis
pylhb4redis 是我在工作过程中陆续整理的一个 Python Redis 工具包,里面就放在一个关于Redis操作的类及相关函数。与其说是一个正式的开源项目,不如说是我自己的“代码杂物间”——只不过把它打包了一下,方便在不同项目之间复用。
由于是个人使用为主,很多设计可能带着比较强的个人习惯,也未必是最优解。
如果您发现了问题或有更好的建议,非常欢迎指正。
申明:操作前请作好备份,本人对所有操作结果拥有所有解释权。
安装
pip install pylhb4redis
🌺mypymssql模块
Redis操作
使用示例:
from pylhb4redis.myredis import MyRedis
if __name__=="__main__":
r=MyRedis()
# 键值对测试
print("--键值对测试--")
r.set("Name","Mr.Lee")
name=r.get("Name")
print(name)
# 哈希表
print("--哈希表测试--")
hdata={
"Name":"Mr.Lee",
"Age":19
}
r.hset("Man",hdata)
name=r.hget("Man","Name")
age=r.hget("Man","Age")
print(name,age)
# 列表处理
print("--列表处理--")
names=["小红","小明"]
r.lpush("Studends",names)
students=r.lrangle("Studends")
print(students)
# 集合处理
print("--集合处理--")
names=["李生","孔姐","李生"]
r.sadd("Peoples",names)
mans=r.smemebers("Peoples")
print(mans)
# 遍历所有键
print("--遍历所有键--")
r.fetchAll()
# 清除所有键
print("--清除所有键--")
r.flushall()
🌺License
本项目基于 MIT 许可证开源。MIT 是一种宽松的开源许可证,允许任何人免费使用、修改、分发本软件,包括用于商业用途。详见 LICENSE 文件。
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
pylhb4redis-1.1.0.tar.gz
(3.9 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file pylhb4redis-1.1.0.tar.gz.
File metadata
- Download URL: pylhb4redis-1.1.0.tar.gz
- Upload date:
- Size: 3.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via:
uv/0.12.7 {"installer":{"name":"uv","version":"0.12.7","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":null,"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4eb2668e970a76da1421e4ffb8cf2819305c20c380e707d38eebcca65926035a
|
|
| MD5 |
7c93cea9495b409bbdc6d66b99ce249a
|
|
| BLAKE2b-256 |
0a516d3ed4313e8525683d71e979afe106aac86d45895cdd6785583e0b0ecb50
|
File details
Details for the file pylhb4redis-1.1.0-py3-none-any.whl.
File metadata
- Download URL: pylhb4redis-1.1.0-py3-none-any.whl
- Upload date:
- Size: 4.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via:
uv/0.12.7 {"installer":{"name":"uv","version":"0.12.7","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":null,"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1615cebc94a8bf378e5a4fb8b4f462b0338861040403452d230cee9a1dffbaed
|
|
| MD5 |
163ae598b69a9f6a10841780fa92fd23
|
|
| BLAKE2b-256 |
63114e8a8f3e85556c9f022b6f19d6bc4d75e4a4531851db9a6f96784c2bc35f
|