https://github.com/answerdotai/tinyredis
Experimental minimalist API for redis
https://github.com/answerdotai/tinyredis
Last synced: 4 days ago
JSON representation
Experimental minimalist API for redis
- Host: GitHub
- URL: https://github.com/answerdotai/tinyredis
- Owner: AnswerDotAI
- License: apache-2.0
- Created: 2024-07-01T00:11:28.000Z (12 months ago)
- Default Branch: main
- Last Pushed: 2024-12-21T23:31:09.000Z (6 months ago)
- Last Synced: 2025-06-26T11:13:28.831Z (4 days ago)
- Language: Python
- Size: 11.7 KB
- Stars: 5
- Watchers: 8
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# tinyredis
> *Experimental minimalist API for redis*
pip install tinyredis
## Sample
```python
import redis
from tinyredis import TinyRedis
from dataclasses import dataclass@dataclass
class Todo: id:int; title:str; done:bool=Falsetodos = 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)
```