NordVPN client with API fallback support
Project description
nyord-vpn
A simple and reliable NordVPN client for macOS with support for both legacy OpenVPN and njord APIs.
Features
- Simple and reliable VPN connection management
- Support for both legacy OpenVPN and njord APIs
- Country selection
- Basic status monitoring
- Clear error messages
- Minimal dependencies
Installation
# Install system requirements
brew install openvpn
# Install package
pip install nyord-vpn
# Optional: Install njord support
pip install nyord-vpn[njord]
Usage
Environment Variables
Set your NordVPN credentials:
export NORD_USER="your-username"
export NORD_PASSWORD="your-password"
CLI Commands
# Connect to VPN (defaults to US)
nyord-vpn connect
# Connect to specific country
nyord-vpn connect --country netherlands
# Use njord API
nyord-vpn --api njord connect
# Enable debug logging
nyord-vpn --verbose connect
# Check status
nyord-vpn status
# List available countries
nyord-vpn list-countries
# Disconnect
nyord-vpn disconnect
Python API
from nyord_vpn.core.factory import create_client
# Create client (legacy or njord)
client = create_client("legacy")
# Connect to VPN
client.connect("netherlands")
# Check status
status = client.status()
print(f"Connected to {status['server']} ({status['ip']})")
# Disconnect
client.disconnect()
Development
# Install dependencies
pip install -r requirements.txt
# Install optional njord support
pip install njord
# Run with debug logging
NORD_USER="username" NORD_PASSWORD="password" nyord-vpn --verbose connect
Error Handling
The client uses simple retry logic for API calls and provides clear error messages. Common errors:
VPNCredentialsError: Missing or invalid credentialsVPNConnectionError: Failed to connect/disconnectVPNConfigError: Configuration issues (e.g., missing OpenVPN)VPNServerError: Failed to get server information
Contributing
- Fork the repository
- Create a feature branch
- Make your changes
- Submit a pull request
License
MIT
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
nyord_vpn-0.1.0.tar.gz
(451.5 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
nyord_vpn-0.1.0-py3-none-any.whl
(30.2 kB
view details)
File details
Details for the file nyord_vpn-0.1.0.tar.gz.
File metadata
- Download URL: nyord_vpn-0.1.0.tar.gz
- Upload date:
- Size: 451.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4228b41535b112a0c532a3e22e788ce5af4e05188b806c87eddcf028e37286ef
|
|
| MD5 |
3b39552917c9a2cd0108808afa11a092
|
|
| BLAKE2b-256 |
ff3d18cfae02a135606e432bfb603e355851bd5cc7aae31ad887e3f019bf7813
|
File details
Details for the file nyord_vpn-0.1.0-py3-none-any.whl.
File metadata
- Download URL: nyord_vpn-0.1.0-py3-none-any.whl
- Upload date:
- Size: 30.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f4b1e74007514d2df6b1b157f68133e1e549cd914d87db305a334d2d86334f8d
|
|
| MD5 |
9407a58c2ef5f2aa8c414754f1c5a5c6
|
|
| BLAKE2b-256 |
96994effbbb19e2068ea53ed53c55da287600f1a769ceefeca8cfe014d6f153d
|