Minimalist API for redis
Project description
tinyredis
Experimental minimalist API for redis
pip install tinyredis
Sample
import redis
from tinyredis import TinyRedis
from dataclasses import dataclass
@dataclass
class Todo: id:int; title:str; done:bool=False
todos = TinyRedis(redis.from_url(YOUR_URL), Todo)
todo = todos.insert(Todo(1, "Create README example"))
# or: todo = todos.insert(title="Create README example")
# if you don't pass `id`, a uuid4 id will be created for you
print(todos()) # Prints all todos
todo.done = True
todos.update(todo)
print(todos[todo.id])
todos.delete(todo.id)
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
tinyredis-0.0.2.tar.gz
(7.2 kB
view hashes)
Built Distribution
tinyredis-0.0.2-py3-none-any.whl
(10.3 kB
view hashes)
Close
Hashes for tinyredis-0.0.2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1a16a7eaea28c615e4313503d345175ec5174b222aa2123b4db876a45f2cfd16 |
|
MD5 | fdf042b7949f2f46cc93cece83709ca4 |
|
BLAKE2b-256 | 404491fadb81c2bf5ddf63bcd05f07b3e2b9abe46667cd906460d6aa6c869071 |