Skip to content

Instantly share code, notes, and snippets.

View WolfMTK's full-sized avatar
🎯
Focusing

Alexander Kuzmin WolfMTK

🎯
Focusing
View GitHub Profile
@WolfMTK
WolfMTK / example.py
Created October 30, 2025 09:02
Example implementation of a repository in python
import uuid
from dataclasses import dataclass, field, asdict
@dataclass(slots=True, kw_only=True)
class ClientEntity:
id: str = field(default_factory=lambda: str(uuid.uuid4()))
first_name: str
last_name: str
wallet: str
@WolfMTK
WolfMTK / connect.py
Last active August 11, 2024 18:06
Creating a sqlalchemy session in Litestar
# Litestar
from collections.abc import Callable, AsyncIterator
from sqlalchemy.ext.asyncio import (
AsyncSession,
async_sessionmaker,
create_async_engine,
)