Skip to main content

A Python SDK for interacting with the Remnawave API.

Project description

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.

✨ 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

If you need dev version:

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

🫥 Compatible versions

Contract Version Remnawave Panel Version
1.1.3 >=1.6.12
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

Here’s 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.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

remnawave_api-1.1.3.tar.gz (23.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

remnawave_api-1.1.3-py3-none-any.whl (40.1 kB view details)

Uploaded Python 3

File details

Details for the file remnawave_api-1.1.3.tar.gz.

File metadata

  • Download URL: remnawave_api-1.1.3.tar.gz
  • Upload date:
  • Size: 23.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.8

File hashes

Hashes for remnawave_api-1.1.3.tar.gz
Algorithm Hash digest
SHA256 017985fe0804c7793c83a84f12d72cc42361dc782496206d399c5b1c1a89303e
MD5 c1bbc26ae320df8aa31843a6c98d768c
BLAKE2b-256 2d70191f52aefcbf0b491faa3d30d0a7814b99f60376970b0c70e549a4eb2ff1

See more details on using hashes here.

Provenance

The following attestation bundles were made for remnawave_api-1.1.3.tar.gz:

Publisher: upload.yml on sm1ky/remnawave-api

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file remnawave_api-1.1.3-py3-none-any.whl.

File metadata

  • Download URL: remnawave_api-1.1.3-py3-none-any.whl
  • Upload date:
  • Size: 40.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.8

File hashes

Hashes for remnawave_api-1.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 975f54809b8f8066f13901b3ffb9a0d7e3fe1e237262ced6656382879528b89d
MD5 c11106dd8f635a7690d95f14522dbd56
BLAKE2b-256 793478aa085db60290b385b0ea3151a4da782402bbaa068f96704862c11f308f

See more details on using hashes here.

Provenance

The following attestation bundles were made for remnawave_api-1.1.3-py3-none-any.whl:

Publisher: upload.yml on sm1ky/remnawave-api

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page