Skip to main content

Litedis 是一个轻量级的 模仿Redis 的本地实现,它实现了和 Redis 类似的功能

Project description

Litedis

Litedis 是一个轻量级的 模仿Redis 的本地实现,它实现了和 Redis 类似的功能,支持基本的数据结构和操作。适合调试代码时,没有 Redis 服务器或者不想连接 Redis 服务器的情况下使用。

功能特点

  • 实现了基础数据结构:
    • STING
    • LIST
    • HASH
    • SET
    • ZSET
  • 支持过期时间设置
  • 支持持久化,包括 AOF 和 RDB、以及混合模式
  • 简单轻量,数据存储在本地,无需服务器

使用示例

基本使用

import time

from litedis import Litedis

with Litedis("litedis:///data/db") as db:
    db.set("key", "value", ex=1)
    assert db.get("key") == "value"

    time.sleep(1.1)
    assert not db.get("key")

存在问题

  • 不支持多进程(以后也不打算支持,有多进程需求的建议使用 Redis)
  • 还有一些 Redis 命令方法未实现

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

litedis-2.1.7.tar.gz (18.9 kB view details)

Uploaded Source

Built Distribution

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

litedis-2.1.7-py3-none-any.whl (20.2 kB view details)

Uploaded Python 3

File details

Details for the file litedis-2.1.7.tar.gz.

File metadata

  • Download URL: litedis-2.1.7.tar.gz
  • Upload date:
  • Size: 18.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.10.14

File hashes

Hashes for litedis-2.1.7.tar.gz
Algorithm Hash digest
SHA256 1e5970931bd27849eafe1aa916058bcd35c09565d783e8d7ac714bddc549dda9
MD5 9a725d23a597c97f7df1970eb557e406
BLAKE2b-256 b90285fc476f646619560b4f9c9158242a705ec12b101d3f3b177daa9cda885d

See more details on using hashes here.

File details

Details for the file litedis-2.1.7-py3-none-any.whl.

File metadata

  • Download URL: litedis-2.1.7-py3-none-any.whl
  • Upload date:
  • Size: 20.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.10.14

File hashes

Hashes for litedis-2.1.7-py3-none-any.whl
Algorithm Hash digest
SHA256 9bc68317855425774cb34429badb9b43c2c3c0ed51b101a561c75be6ac93ba1c
MD5 be2edb191ea0bf784968324ebe47a58a
BLAKE2b-256 d867a56642c09c99b9d8788489b6685bed8931811adea2d4873c6a810a5ab5f7

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