Skip to main content

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:
        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


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.2.tar.gz (4.4 kB view details)

Uploaded Source

Built Distribution

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

wg_easy_api-0.1.2-py3-none-any.whl (5.5 kB view details)

Uploaded Python 3

File details

Details for the file wg_easy_api-0.1.2.tar.gz.

File metadata

  • Download URL: wg_easy_api-0.1.2.tar.gz
  • Upload date:
  • Size: 4.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.5 CPython/3.12.8 Linux/6.5.0-1025-azure

File hashes

Hashes for wg_easy_api-0.1.2.tar.gz
Algorithm Hash digest
SHA256 3838ba558a699528e511fc3538c5ddb60af7b129be9cc8d2e91ca1f20ccc54fa
MD5 21978c644661b955e66b015e335072af
BLAKE2b-256 203881f21743ad3075948d49b0086cb79b897a0cfac6f0437567e3610311a3f1

See more details on using hashes here.

File details

Details for the file wg_easy_api-0.1.2-py3-none-any.whl.

File metadata

  • Download URL: wg_easy_api-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 5.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.5 CPython/3.12.8 Linux/6.5.0-1025-azure

File hashes

Hashes for wg_easy_api-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 582b3bb4515516c8e99ce1b21618790dfa3609760029138c68e28f76b3bd799a
MD5 d814452f8acbec8e4e7d9b6e642b0181
BLAKE2b-256 889a3c87f45f7dd827ec993298691b10cc355bdd890c5d07de037dc3861065ba

See more details on using hashes here.

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