outline-vpn-api-async
A Python API wrapper for Outline VPN
This is a fork of https://github.com/jadolg/outline-vpn-api
How to use
from outline_vpn import OutlineVPN
async def main():
client = OutlineVPN(api_url="https://127.0.0.1:51083/xlUG4F5BBft4rSrIvDSWuw")
await client.init(cert_sha256="4EFF7BB90BCE5D4A172D338DC91B5B9975E197E39E3FA4FC42353763C4E58765")
for key in await client.get_keys():
print(key.access_url)
my_cool_key = await client.get_key(key_id=1337)
print(my_cool_key.access_url)
new_key = await client.create_key()
new_key = await client.create_key(key_name="My cool key")
await client.rename_key(key_id=new_key.key_id, name="new_key")
await client.delete_key(key_id=new_key.key_id)
await client.add_data_limit(key_id=new_key.key_id, limit_bytes=1000 * 1000 * 20)
await client.delete_data_limit(key_id=new_key.key_id)
if __name__ == "__main__":
import asyncio
asyncio.run(main())
Contribution
Install locally
pip install -e .
Fill out test.env with your test server creds
cp test.env.example test.env
Run tests
pytest