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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
litedis-1.0.0.tar.gz
(9.3 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
litedis-1.0.0-py3-none-any.whl
(10.5 kB
view details)
File details
Details for the file litedis-1.0.0.tar.gz.
File metadata
- Download URL: litedis-1.0.0.tar.gz
- Upload date:
- Size: 9.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.10.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5f0d850edb791d7a3c868fa54f4ce434d7b14fd4c08b21ee7e2e3f24a3148373
|
|
| MD5 |
0e41bad0d11766a7143f75200539e168
|
|
| BLAKE2b-256 |
25625d413037dc448e6de754a8aa4bfefd26e85345ec13a209b98b106e769b53
|
File details
Details for the file litedis-1.0.0-py3-none-any.whl.
File metadata
- Download URL: litedis-1.0.0-py3-none-any.whl
- Upload date:
- Size: 10.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.10.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9907dc5639bc7cd17c5062696d9faaf08ac27daf81a0409f8d62433a8dde46d1
|
|
| MD5 |
44f9be0be419a24303f34d11430e6a51
|
|
| BLAKE2b-256 |
c0d2bef8221631d5659ceba78cbaae1082fcf5224161171ef7e8f3bf2914328f
|