Skip to main content

Mr.Lee's Redis Helpers

Project description

pylhb4redis

PyPI version GitHub stars GitHub license GitHub repo size GitHub forks

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()

Project details


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.0.0.tar.gz (3.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pylhb4redis-1.0.0-py3-none-any.whl (4.8 kB view details)

Uploaded Python 3

File details

Details for the file pylhb4redis-1.0.0.tar.gz.

File metadata

  • Download URL: pylhb4redis-1.0.0.tar.gz
  • Upload date:
  • Size: 3.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.18 {"installer":{"name":"uv","version":"0.11.18","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

Hashes for pylhb4redis-1.0.0.tar.gz
Algorithm Hash digest
SHA256 0cc2b8cd3707744b20103e7e6f20f31badd7931deb54d97c53f910c02fada981
MD5 ed8f1cf281e9746491477605467f623e
BLAKE2b-256 4f885fb8360bfa07cf5df12ff026934d482a88ef8b825359a79542c68c25eddf

See more details on using hashes here.

File details

Details for the file pylhb4redis-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: pylhb4redis-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 4.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.18 {"installer":{"name":"uv","version":"0.11.18","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

Hashes for pylhb4redis-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 cb858a1c516447cfb9da27207bcdb66ebae51581e5b6465f8266e26474f3dd40
MD5 16544e6cb1befef79f697d2d9f79724a
BLAKE2b-256 461ba74c9953af1ba981e805640fd2be078b24024e330e46f839af542d5b0058

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page