No description
Find a file
masasibata 21f3c83a2c refactor(models): rename to *Dto pattern and add ExternalSquads support
- Rename HwidSettings to HwidSettingsDto
- Rename CustomRemarks to CustomRemarksDto
- Maintain backward compatibility via aliases
- Update ExternalSquads models to use new DTO classes
2025-12-10 21:14:08 +03:00
.github/workflows feat: Удалить шаг инспекции METADATA из рабочего процесса публикации 2025-05-10 21:14:45 +02:00
.vscode feat: Добавить тесты для валидации вебхука в test_utils.py 2025-07-09 03:01:35 +02:00
remnawave refactor(models): rename to *Dto pattern and add ExternalSquads support 2025-12-10 21:14:08 +03:00
tests fix: исправить алиасы в эндпоинтах и удалить неиспользуемые DTO 2025-12-03 05:31:17 +01:00
.DS_Store feat: Add models for subscriptions, users, and system statistics 2025-04-21 20:44:27 +02:00
.gitignore fix: update serialization aliases in user models 2025-11-12 00:17:05 +01:00
LICENSE feat: Add models for subscriptions, users, and system statistics 2025-04-21 20:44:27 +02:00
poetry.lock feat: Add cryptography dependency and implement HAPP crypto link generation 2025-11-25 20:42:12 +01:00
pyproject.toml feat: обновить версии API и добавить новые модели для работы с HWID и пользователями 2025-12-10 05:39:29 +01:00
pytest.ini feat: Refactor API endpoints and models for HWID management; add new HWID user controller and models 2025-05-02 15:05:31 +02:00
README.md feat: обновить версии API и добавить новые модели для работы с HWID и пользователями 2025-12-10 05:39:29 +01:00

Remnawave Python SDK

📢 Repository Migration Notice

This repository has been moved from sm1ky/remnawave-api to remnawave/python-sdk.

PyPI Package Migration:

  • Legacy versions (≤1.x): Available at remnawave_api (deprecated)
  • New versions (≥2.x): Available at remnawave

Please update your dependencies to use the new package name for future updates.

Stars Forks Issues Supported python versions Downloads PyPi Package Version Publish Python Package

A Python SDK client for interacting with the Remnawave API. This library simplifies working with the API by providing convenient controllers, Pydantic models for requests and responses, and fast serialization with orjson.

🎉 Version 2.0.0 brings full compatibility with the latest Remnawave backend API, including new endpoints, improved response wrappers, and enhanced type safety.

Key Features

  • Full v2.0.0 API compatibility: Updated for latest Remnawave backend features
  • New controllers: ConfigProfiles, InternalSquads, InfraBilling, NodesUsageHistory
  • Enhanced models: OpenAPI-compliant response wrappers with improved field mappings
  • Controller-based design: Split functionality into separate controllers for flexibility. Use only what you need!
  • Pydantic models: Strongly-typed requests and responses for better reliability.
  • Fast serialization: Powered by orjson for efficient JSON handling.
  • Modular usage: Import individual controllers or the full SDK as needed.
  • Backward compatibility: Legacy aliases maintained for smooth migration.

📦 Installation

Install the latest version from the new PyPI package:

pip install remnawave

Legacy Package (Deprecated)

If you need older versions (≤1.x), use the legacy package:

pip install remnawave_api  # Deprecated - use 'remnawave' instead

Development Version

If you need the development version:

pip install git+https://github.com/remnawave/python-sdk.git@development

🫥 Compatible versions

Contract Version Remnawave Panel Version
2.3.2 >=2.3.0
2.3.0 >=2.3.0, <2.3.2
2.2.6 ==2.2.6
2.2.3 >=2.2.13
2.1.19 >=2.1.19, <2.2.0
2.1.18 >=2.1.18
2.1.17 >=2.1.16, <=2.1.17
2.1.16 >=2.1.16
2.1.13 >=2.1.13, <=2.1.15
2.1.9 >=2.1.9, <=2.1.12
2.1.8 ==2.1.8
2.1.7.post1 ==2.1.7
2.1.4 >=2.1.4, <2.1.7
2.1.1 >=2.1.1, <2.1.4
2.0.0 >=2.0.0,<2.1.0
1.1.3 >=1.6.12,<2.0.0
1.1.2 >=1.6.3,<=1.6.11
1.1.1 1.6.1, 1.6.2
1.1.0 1.6.0
1.0.8 1.5.7

Dependencies

  • orjson (>=3.10.15, <4.0.0)
  • rapid-api-client (==0.6.0)
  • httpx (>=0.27.2, <0.28.0)

🚀 Usage

Heres a quick example to get you started:

import os
import asyncio

from remnawave import RemnawaveSDK  # Updated import for new package
from remnawave.models import (  # Updated import path
    UsersResponseDto, 
    UserResponseDto,
    GetAllConfigProfilesResponseDto,
    CreateInternalSquadRequestDto
)

async def main():
    # URL to your panel (ex. https://vpn.com or http://127.0.0.1:3000)
    base_url: str = os.getenv("REMNAWAVE_BASE_URL")
    # Bearer Token from panel (section: API Tokens) 
    token: str = os.getenv("REMNAWAVE_TOKEN")

    # Initialize the SDK
    remnawave = RemnawaveSDK(base_url=base_url, token=token)

    # Fetch all users
    response: UsersResponseDto = await remnawave.users.get_all_users_v2()
    total_users: int = response.total
    users: list[UserResponseDto] = response.users
    print("Total users: ", total_users)
    print("List of users: ", users)

if __name__ == "__main__":
    asyncio.run(main())

🧪 Running Tests

To run the test suite, use Poetry:

poetry run pytest

❤️ About

This SDK was originally developed by @kesevone for integration with Remnawave's API.

Previously maintained by @sm1ky at sm1ky/remnawave-api.

Now officially maintained by the Remnawave Community at remnawave/python-sdk.