Skip to content

A modern, async-first Python client for the Outline VPN Server API with comprehensive data validation through Pydantic models.

License

Notifications You must be signed in to change notification settings

orenlab/pyoutlineapi

Repository files navigation

PyOutlineAPI

Enterprise-grade async Python client for Outline VPN Server Management API

tests codecov Security Rating Maintainability Rating Vulnerabilities

PyPI - Downloads PyPI - Version Python Version License


Overview

PyOutlineAPI is a modern, production-ready Python library for managing Outline VPN servers. It is async-first, type-safe, and designed for reliable operation in production.

Highlights:

  • Async-first client built on aiohttp
  • Certificate pinning + sensitive data protection
  • Circuit breaker, health monitoring, retries with backoff
  • Typed models (Pydantic v2) + rich validation
  • Batch operations and rate limiting

Installation

Requirements: Python 3.10+

Using pip:

pip install pyoutlineapi

Using uv (recommended):

uv add pyoutlineapi

Optional dependencies:

# Development tools
pip install pyoutlineapi[dev]

Quick Start

1) Setup configuration

# Generate .env template
python -c "from pyoutlineapi import quick_setup; quick_setup()"

# Edit .env.example → .env
OUTLINE_API_URL=https://your-server.com:12345/your-secret-path
OUTLINE_CERT_SHA256=your-64-character-sha256-fingerprint

2) Minimal usage

from pyoutlineapi import AsyncOutlineClient
import asyncio


async def main():
    async with AsyncOutlineClient.from_env() as client:
        server = await client.get_server_info()
        print(f"Server: {server.name} (v{server.version})")

        key = await client.create_access_key(name="Alice")
        print(f"Access URL: {key.access_url}")

        keys = await client.get_access_keys()
        print(f"Total keys: {keys.count}")


asyncio.run(main())

Documentation

Detailed examples and guides are in docs/guides/. Start with the index:


License

MIT. See LICENSE.

About

A modern, async-first Python client for the Outline VPN Server API with comprehensive data validation through Pydantic models.

Topics

Resources

License

Contributing

Security policy

Stars

Watchers

Forks

Languages