Files
remnawave-bedolaga-telegram…/app/lib/nalogo/user.py
c0mrade 9a2aea038a chore: add uv package manager and ruff linter configuration
- Add pyproject.toml with uv and ruff configuration
- Pin Python version to 3.13 via .python-version
- Add Makefile commands: lint, format, fix
- Apply ruff formatting to entire codebase
- Remove unused imports (base64 in yookassa/simple_subscription)
- Update .gitignore for new config files
2026-01-24 17:45:27 +03:00

41 lines
937 B
Python

"""
User API implementation.
Based on PHP library's Api\\User class.
"""
from typing import Any
from ._http import AsyncHTTPClient
class UserAPI:
"""
User API for user information.
Provides async methods for:
- Getting current user information
Maps to PHP Api\\User functionality.
"""
def __init__(self, http_client: AsyncHTTPClient):
self.http = http_client
async def get(self) -> dict[str, Any]:
"""
Get current user information.
Maps to PHP User::get().
Returns:
Dictionary with user profile data including:
- id, inn, displayName, email, phone
- registration dates, status, restrictions
- avatar, receipt settings, etc.
Raises:
DomainException: For API errors
"""
response = await self.http.get('/user')
return response.json() # type: ignore[no-any-return]