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")
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-2.2.0.tar.gz
(19.2 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-2.2.0-py3-none-any.whl
(20.7 kB
view details)
File details
Details for the file litedis-2.2.0.tar.gz.
File metadata
- Download URL: litedis-2.2.0.tar.gz
- Upload date:
- Size: 19.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.8.20
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2fb6a640694d38acc40e88053132b0710602c0d1ab2b3be035de190ce276ce51
|
|
| MD5 |
e42aecdc0ab66c18d7381723f4cd897e
|
|
| BLAKE2b-256 |
342180debbcf9c7096eba2769cf01cf0bc2cfdf7eb311fd91c8c4fddffb76ddc
|
File details
Details for the file litedis-2.2.0-py3-none-any.whl.
File metadata
- Download URL: litedis-2.2.0-py3-none-any.whl
- Upload date:
- Size: 20.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.8.20
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7326c0a7a2eaf0f49d28cac2b511d0a654ebb8ee69775c513e1a3b23f9726823
|
|
| MD5 |
50759d640433c09ab73ff789c6798051
|
|
| BLAKE2b-256 |
9b9ff887554d87ece6585d2bbf70f9b137336c371fcac7285e7a687ce172f31b
|