Skip to content

AnswerDotAI/tinyredis

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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)

About

Experimental minimalist API for redis

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages