Metadata-Version: 2.4
Name: pyoutlineapi
Version: 0.4.0
Summary: Production-ready async Python client for Outline VPN Server API with enterprise-grade features and full type safety.
Author-email: Denis Rozhnovskiy <pytelemonbot@mail.ru>
License: MIT License
        
        Copyright (c) 2024 Denis Rozhnovskiy
        
        Permission is hereby granted, free of charge, to any person obtaining a copy
        of this software and associated documentation files (the "Software"), to deal
        in the Software without restriction, including without limitation the rights
        to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
        copies of the Software, and to permit persons to whom the Software is
        furnished to do so, subject to the following conditions:
        
        The above copyright notice and this permission notice shall be included in all
        copies or substantial portions of the Software.
        
        THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
        IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
        FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
        AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
        LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
        OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
        SOFTWARE.
        
Project-URL: Homepage, https://github.com/orenlab/pyoutlineapi
Project-URL: Repository, https://github.com/orenlab/pyoutlineapi
Project-URL: Documentation, https://orenlab.github.io/pyoutlineapi/
Project-URL: Changelog, https://github.com/orenlab/pyoutlineapi/blob/main/CHANGELOG.md
Project-URL: Bug Tracker, https://github.com/orenlab/pyoutlineapi/issues
Project-URL: Discussions, https://github.com/orenlab/pyoutlineapi/discussions
Keywords: outline,vpn,api,async,asyncio,aiohttp,pydantic,client,manager,production,enterprise
Classifier: Development Status :: 5 - Production/Stable
Classifier: Intended Audience :: Developers
Classifier: Intended Audience :: System Administrators
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Python :: 3.14
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Framework :: AsyncIO
Classifier: Framework :: aiohttp
Classifier: Framework :: Pydantic
Classifier: Framework :: Pydantic :: 2
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Classifier: Topic :: Internet :: WWW/HTTP :: HTTP Servers
Classifier: Topic :: Internet :: Proxy Servers
Classifier: Topic :: Security
Classifier: Topic :: System :: Networking
Classifier: Operating System :: OS Independent
Classifier: Typing :: Typed
Requires-Python: <4.0,>=3.10
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: aiohttp>=3.13.3
Requires-Dist: pydantic>=2.12.5
Requires-Dist: pydantic-settings>=2.12.0
Dynamic: license-file

# PyOutlineAPI

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

[![tests](https://github.com/orenlab/pyoutlineapi/actions/workflows/python_tests.yml/badge.svg)](https://github.com/orenlab/pyoutlineapi/actions/workflows/python_tests.yml)
[![codecov](https://codecov.io/gh/orenlab/pyoutlineapi/branch/main/graph/badge.svg?token=D0MPKCKFJQ)](https://codecov.io/gh/orenlab/pyoutlineapi)
[![Security Rating](https://sonarcloud.io/api/project_badges/measure?project=orenlab_pyoutlineapi&metric=security_rating)](https://sonarcloud.io/summary/new_code?id=orenlab_pyoutlineapi)
[![Maintainability Rating](https://sonarcloud.io/api/project_badges/measure?project=orenlab_pyoutlineapi&metric=sqale_rating)](https://sonarcloud.io/summary/new_code?id=orenlab_pyoutlineapi)
[![Vulnerabilities](https://sonarcloud.io/api/project_badges/measure?project=orenlab_pyoutlineapi&metric=vulnerabilities)](https://sonarcloud.io/summary/new_code?id=orenlab_pyoutlineapi)

![PyPI - Downloads](https://img.shields.io/pypi/dm/pyoutlineapi)
![PyPI - Version](https://img.shields.io/pypi/v/pyoutlineapi)
![Python Version](https://img.shields.io/pypi/pyversions/pyoutlineapi)
![License](https://img.shields.io/pypi/l/pyoutlineapi)

---

## Overview

PyOutlineAPI is a modern, **production-ready** Python library for managing [Outline VPN](https://getoutline.org/)
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`:

```bash
pip install pyoutlineapi
```

Using `uv` (recommended):

```bash
uv add pyoutlineapi
```

**Optional dependencies:**

```bash
# Development tools
pip install pyoutlineapi[dev]
```

---

## Quick Start

### 1) Setup configuration

```bash
# 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

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

- [Guides index](docs/guides/README.md) (full list)
- [Access keys](docs/guides/access-keys.md)
- [Server management](docs/guides/server-management.md)
- [Metrics](docs/guides/metrics.md)
- [Enterprise features](docs/guides/enterprise-features.md)
- [Configuration](docs/guides/configuration.md)
- [Error handling](docs/guides/error-handling.md)
- [Best practices](docs/guides/best-practices.md)

---

## License

MIT. See `LICENSE`.
