Metadata-Version: 2.1
Name: wg-easy-api
Version: 0.1.0
Summary: API wrapper for wg-easy
License: MIT
Author: d0gied
Author-email: german.n.u@mail.ru
Requires-Python: >=3.12,<4.0
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.12
Requires-Dist: aiohttp (>=3.10.7,<4.0.0)
Requires-Dist: pydantic (>=2.9.2,<3.0.0)
Description-Content-Type: text/markdown

# wg-easy-api
API wrapper for wg-easy

# Installation

```bash
pip install wg-easy-api
```

# Usage

```python
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())
```

