API wrapper for wg-easy
Project description
wg-easy-api
API wrapper for wg-easy
Installation
pip install wg-easy-api
Usage
from wg_easy_api import WgEasy
wg = WgEasy("http://wg-easy.sample.com:8080", "password")
async def main():
clients = await wg.get_clients() # Get all clients
client = await wg.get_client(clients[0].id) # Get client by id
await wg.create_client("demo_client") # Create client
await wg.rename_client(client.id, "new_demo_client") # Rename client
await wg.change_client_address(client.id, "10.20.30.40") # Change client address
await wg.disable_client(client.id) # Disable client
await wg.enable_client(client.id) # Enable client
with open("client.conf", "w") as f:
await f.write(await wg.get_client_config(client.id)) # Get client configuration
with open("qrcode.svg", "wb") as f:
await f.write(await wg.get_client_qrcode(client.id)) # Get client QR code
await wg.delete_client(client.id) # Delete client
if __name__ == "__main__":
import asyncio
asyncio.run(main())
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
wg_easy_api-0.1.1.tar.gz
(4.3 kB
view hashes)
Built Distribution
Close
Hashes for wg_easy_api-0.1.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9f28af6a695af9b879c831288ba59c5aa3a2d44dea872be3da7b93d33c09ea70 |
|
MD5 | 16cd374bae87d546781cbb2460c5afc1 |
|
BLAKE2b-256 | 464b4a47e180dc313dfb372767b7ba717f8a813c4bc98710570d6b1364a5293f |