Skip to main content

A Python SDK for interacting with the Remnawave API v2.3.0.

Project description

Remnawave Python SDK

[!WARNING] This repository is a fork of the official SDK remnawave/python-sdk.

Stars Forks Issues Supported python versions Downloads PyPi Package Version

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.3.0 brings full compatibility with the latest Remnawave backend API, including new endpoints, improved response wrappers, and enhanced type safety.

✨ Key Features

  • Full v2.3.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

Production Version

Install the latest version from the new PyPI package:

pip install remnapy

Development Version

If you need the development version:

pip install git+https://github.com/snoups/remnapy.git@development

🫥 Compatible versions

Contract Version Remnawave Panel Version
2.3.0 >=2.3.0

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 remnapy import RemnawaveSDK  # Updated import for new package
from remnapy.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.

The official Remnawave repository is located at remnawave/python-sdk.

This repository is a fork of the official SDK.

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

remnapy-2.3.2.tar.gz (124.4 kB view details)

Uploaded Source

Built Distribution

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

remnapy-2.3.2-py3-none-any.whl (78.6 kB view details)

Uploaded Python 3

File details

Details for the file remnapy-2.3.2.tar.gz.

File metadata

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

File hashes

Hashes for remnapy-2.3.2.tar.gz
Algorithm Hash digest
SHA256 c8594d04319dab6c233b3adf241531e4a98c3c9670692bac1e3687e858b0ea7d
MD5 266c2b7de71637e984ee6e22dbe288d3
BLAKE2b-256 9f05c6aa9dae9dee923543b8c61231684a1f203248a11af656ab5b7e184516e8

See more details on using hashes here.

Provenance

The following attestation bundles were made for remnapy-2.3.2.tar.gz:

Publisher: release.yml on snoups/remnapy

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

File details

Details for the file remnapy-2.3.2-py3-none-any.whl.

File metadata

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

File hashes

Hashes for remnapy-2.3.2-py3-none-any.whl
Algorithm Hash digest
SHA256 ace0a7fce44c9eccca26b1e3e9fe8a5b67d8590e07e4a03cd4bf72416c910432
MD5 5f4f3b649ac2883ba213b5a991cbf980
BLAKE2b-256 23b427f09be6d255586062c631fa7e0974955b8520ebe3a7a19d41f566341598

See more details on using hashes here.

Provenance

The following attestation bundles were made for remnapy-2.3.2-py3-none-any.whl:

Publisher: release.yml on snoups/remnapy

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