No description
Find a file
Artem c64756aed1
feat: Add HWIDUserController to the API controllers; update __all__ exports
fix: Remove unused BulkDeleteUsersByStatusRequestDto and BulkDeleteUsersRequestDto from models
2025-05-02 17:19:31 +02:00
.github/workflows fix: Remove unnecessary parameters from PyPI publish action in upload workflow. Enable Trusted Publisher 2025-04-24 21:46:08 +02:00
remnawave_api feat: Add HWIDUserController to the API controllers; update __all__ exports 2025-05-02 17:19:31 +02:00
tests feat: Add models for subscriptions, users, and system statistics 2025-04-21 20:44:27 +02:00
.DS_Store feat: Add models for subscriptions, users, and system statistics 2025-04-21 20:44:27 +02:00
.gitignore feat: Refactor API endpoints and models for HWID management; add new HWID user controller and models 2025-05-02 15:05:31 +02:00
LICENSE feat: Add models for subscriptions, users, and system statistics 2025-04-21 20:44:27 +02:00
poetry.lock feat: Update dependencies in pyproject.toml and add test.py to .gitignore 2025-04-23 17:29:05 +02:00
pyproject.toml feat: Refactor API endpoints and models for HWID management; add new HWID user controller and models 2025-05-02 15:05:31 +02: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: Update README and pyproject.toml for version 1.0.4; enhance UsersController with pagination support 2025-04-24 19:46:48 +02:00

Remnawave SDK

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. Library checked with Remnawave v1.5.7

Key Features

  • 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.

📦 Installation

You can install it directly using pip:

pip install remnawave_api

or with pip from git:

pip install git+https://github.com/sm1ky/remnawave-api.git

🔎 View on pypi

Open


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_api import RemnawaveSDK
from remnawave_api.models import UsersResponseDto, UserResponseDto

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)

    # Disable a specific user
    test_uuid: str = "e4d3f3d2-4f4f-4f4f-4f4f-4f4f4f4f4f4f"
    disabled_user: UserResponseDto = await remnawave.users.disable_user(test_uuid)
    print("Disabled user: ", disabled_user)

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.

Maintained and extended by @sm1ky.