remnawave-client
Sync and async client for the Remnawave API, generated from the panel's OpenAPI specification.
pip install remnawave-client
Requires Python 3.11 or newer.
Versions
The library version equals the API version it was generated from. A tag exists for every minor release of the panel from 2.0 onwards, so pin the one matching your deployment:
pip install remnawave-client==<your panel version>
Quick start
from remnawave import Remnawave
with Remnawave("https://panel.example.com", token) as rw:
user = rw.users.get_user_by_username("zen")
print(user.username, user.status, user.expire_at)
for u in rw.users.iter_users():
print(u.username)
The async client mirrors it:
import asyncio
from remnawave import AsyncRemnawave
async def main() -> None:
async with AsyncRemnawave("https://panel.example.com", token) as rw:
stats = await rw.system.get_stats()
nodes = await rw.nodes.get_nodes()
async for user in rw.users.iter_users():
print(user.username)
asyncio.run(main())
More in examples/: pagination, partial updates, error handling,
webhooks and swapping out the client's parts.
Background jobs
Some checks run as panel jobs: one request starts the job and returns a
jobId, another polls its status. wait_* does both and returns the result:
result = rw.connections.wait_connections_by_user(user_id, timeout=120)
for node in result.nodes:
print(node.node_name, [ip.ip for ip in node.ips])
A job the panel reports as failed raises JobFailedError; one still running
after timeout seconds raises JobTimeoutError. The underlying start and
poll methods stay available.
Errors
Everything the library raises inherits from RemnawaveError. Below it the
hierarchy splits by cause: ApiError for anything the panel answered with,
TransportError when the request never got a reply, SerializationError when
the payload did not match the schema.
from remnawave.exceptions import NotFoundError
try:
rw.users.get_user_by_id(42)
except NotFoundError as error:
print(error.status, error.error_code) # 404 'A025'
error_code is the panel's own code and is more specific than the HTTP
status — branch on it when you need to tell cases apart.
Webhooks
from remnawave.webhooks import SIGNATURE_HEADER, WebhookReceiver
hooks = WebhookReceiver(secret=os.environ["WEBHOOK_SECRET_HEADER"])
event = hooks.receive(request.body, request.headers[SIGNATURE_HEADER])
if event.scope == "user":
print(event.event, event.data.username)
Pass the raw request body: the signature covers those exact bytes, so re-serialising parsed JSON breaks verification.
Regenerating
src/remnawave/_generated/ is machine-written and must not be edited by hand.
Regenerating it against the version the package declares takes no arguments:
python -m tools.codegen
To move the project onto a newer panel release, drop its specification into
specs/ and pass the version once:
python -m tools.codegen <version>
Where the specification is wrong or awkward, overlay.yaml patches it before
generation: type names, forced field types, fields kept out of repr. Editing
the generated code directly would be lost on the next run; editing the vendored
specification would be lost on the next update.
Release files for remnawave-client 3.4.4.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| remnawave_client-3.4.4.2.tar.gz | 42.3 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| remnawave_client-3.4.4.2-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 108.4 kB
Release files / remnawave_client-3.4.4.2.tar.gz
| Download URL | remnawave_client-3.4.4.2.tar.gz |
|---|---|
| Size | 42.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
bd9dce35b63e385ab17941661fddc9dc6d1f0c4c3839e32554e77cf93b0e45a6
|
|
BLAKE2b-256 checksum How to use checksums |
738efc4a035a82a7a160838d1c5d4471a4b3a056c4bda424c40bde555515f618
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
uv/0.12.17 {"installer":{"name":"uv","version":"0.12.17","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|
Release files / remnawave_client-3.4.4.2-py3-none-any.whl
| Download URL | remnawave_client-3.4.4.2-py3-none-any.whl |
|---|---|
| Size | 66.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
b78e227a4d215a94b60e5ea98001d0b6ba28bebeed53b585fb6f4da37e1e79c6
|
|
BLAKE2b-256 checksum How to use checksums |
1389f3d507c5d8593bac4ca750d601e34005916c2e945aae7b0e0821e73789d4
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
uv/0.12.17 {"installer":{"name":"uv","version":"0.12.17","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|