semvec/pypi-packages huggingface dataset:
vpn-controller 1.0.0
Minimal OpenVPN connection manager for ProtonVPN - WSL-optimized
License: MIT
Requires Python: >=3.6
Keywords: vpn, openvpn, protonvpn, wsl, windows

# VPN Controller

Minimal OpenVPN connection manager for ProtonVPN - WSL-optimized.

Designed for Python developers who need VPN protection in their WSL scripts.

## Installation

```bash
pip install vpn-controller
```

## Setup

Create a `.env` file in your project directory:

```env
# ProtonVPN credentials (from account settings)
OPENVPN_USER="username+b1"
OPENVPN_PASS="password"

# OpenVPN config file (download from ProtonVPN)
OVPN_CONFIG="./config.ovpn"

# Path to OpenVPN executable on Windows
OPENVPN_EXE="/mnt/c/Program Files/OpenVPN/bin/openvpn.exe"

# Optional: Your country for connection validation
HOME_COUNTRY="Brazil"

# Optional: Connection timeout in seconds
CONNECT_TIMEOUT="15"
```

**Path formats supported:** Relative (`./file`), home (`~/file`), absolute (`/home/user/file`), Windows drives (`/mnt/c/...`)

## Quick Start

```python
from vpn_controller import VPNController

with VPNController() as vpn:
    if vpn.connect():
        print("Connected to VPN")
        # Your protected code here
    # Automatic disconnect on exit
```

## API Reference

### `VPNController`

Context manager for OpenVPN connection lifecycle.

#### Methods

##### `connect(force=False) -> bool`

Connects to VPN and validates the connection.

**Parameters:**
- `force` (bool): If `True`, kills any existing OpenVPN process before connecting. Default: `False`

**Returns:**
- `bool`: `True` if connected successfully, `False` otherwise

**Raises:**
- `RuntimeError`: Another VPN is running and `force=False`
- `FileNotFoundError`: OpenVPN executable or config file not found
- `ValueError`: Invalid or missing configuration in `.env`

**Example:**
```python
vpn = VPNController()

# Safe mode - fails if VPN already running
vpn.connect()

# Force mode - kills existing VPN first
vpn.connect(force=True)
```

##### `disconnect() -> bool`

Disconnects from VPN and cleans up resources (auth files, processes).

**Returns:**
- `bool`: Always returns `True`

**Example:**
```python
vpn.disconnect()
```

##### `is_connected() -> bool`

Checks if VPN is currently connected by validating IP geolocation.

**Returns:**
- `bool`: `True` if connected to VPN, `False` otherwise

**Example:**
```python
if vpn.is_connected():
    print("VPN is active")
```

#### Context Manager

Automatically disconnects on exit:

```python
with VPNController() as vpn:
    if vpn.connect():
        # Your code here
    # Automatic disconnect happens here
```

## Requirements

- **Python**: 3.6+
- **Platform**: WSL (Windows Subsystem for Linux)
- **Windows**: OpenVPN installed ([download](https://openvpn.net/community-downloads/))
- **Windows**: gsudo installed (`winget install gerardog.gsudo`)
- **Python packages**: `requests` (installed automatically via pip)
- **ProtonVPN**: Account with OpenVPN config file

---

**License:** MIT
pln-search 0.1.3
CLI tool for searching the Protocol Labs Network Directory
License: MIT
Requires Python: >=3.10
Keywords: cli, directory, filecoin, pln, protocol-labs, search

# pln-search

[![Tests](https://github.com/dannyob/pln-search/workflows/Test/badge.svg)](https://github.com/dannyob/pln-search/actions)

Command-line tool for searching the Protocol Labs Network Directory API.

## Installation

### From PyPI (recommended)

```bash
pip install pln-search
```

### From source

```bash
git clone https://github.com/dannyob/pln-search.git
cd pln-search
pip install -e .
```

## Usage

### Authentication

The PLN Directory uses Privy for web authentication. Until we implement a full OAuth2 flow for CLI tools, you'll need to manually configure your authentication token:

**Step 1: Get your token from the browser**

1. Visit https://directory.plnetwork.io/ and log in
2. Open browser Developer Tools (F12 or right-click → Inspect)
3. Go to the **Application** tab (Chrome) or **Storage** tab (Firefox)
4. In the left sidebar, expand **Cookies** and select: `https://directory.plnetwork.io`
5. Find the **`authToken`** cookie and copy its VALUE (a long string starting with `eyJ...`)
6. Optional: Also copy the **`refreshToken`** cookie value

**Step 2: Configure the token**

Option A - Interactive (recommended):
```bash
pln-search auth token --interactive
```

Option B - Command line:
```bash
pln-search auth token YOUR_TOKEN_HERE
```

**Check authentication status:**
```bash
pln-search auth status
```

**Logout (clear credentials):**
```bash
pln-search auth logout
```

### Searching

Search:
```bash
pln-search search "John Doe"                 # Global search
pln-search search --members "John Doe"       # Search members
pln-search search --teams "Protocol Labs"    # Search teams
pln-search search --projects "IPFS"          # Search projects
```

Options:
```bash
pln-search search "query" --limit 50         # Show up to 50 results
pln-search search "query" --json             # JSON output
pln-search search "query" --no-color         # Plain text output
```

## Development

Install dependencies:
```bash
make install-dev
```

Run tests:
```bash
make test
```

Format code:
```bash
make format
```

## Development Status

**Implemented:**
- ✓ Data models (Member, Team, Project)
- ✓ Configuration management with XDG directories
- ✓ API client with search methods
- ✓ Output formatters (rich, plain, JSON)
- ✓ OAuth2 token refresh
- ✓ CLI commands
- ✓ Test suite

**TODO for production use:**
- [ ] Full OAuth2 browser flow (currently stub)
- [ ] Integration testing with real API
- [ ] Error message improvements
- [ ] Performance optimization
- [ ] PyPI packaging

## Testing

The project includes a comprehensive test suite. Note that OAuth2 browser authentication is currently a stub and requires manual token setup for testing against the real API.

For local development and testing, mock the API responses.