Python AirVPN
A Python wrapper for AirVPN's API, covering the bootstrap, web, and REST layers of the service — authenticate, manage devices, generate configs, and check server status without touching cookies, sessions, or encryption yourself.
Note: Docstrings and documentation were AI-assisted. If you spot any errors, please open a PR or an issue.
Installation
From PyPI:
pip install airvpn
From source:
git clone https://github.com/ch0nker/airvpn.git
pip install -e airvpn
Interfaces
The library exposes three interfaces, depending on how much control you need:
AirVPN— high-level wrapper; the best starting point for most use casesAirClient— low-level client for the encrypted bootstrap API (servers, manifest, status)WebClient— client for AirVPN's website/session-based endpoints (account and profile actions)
Quick Start
AirVPN
Log in immediately, by passing credentials on construction. This is the simplest path if you just want to get to work:
import os
from dotenv import load_dotenv
load_dotenv()
from airvpn import AirVPN
vpn = AirVPN(os.getenv("LOGIN"), os.getenv("PASSWORD"))
# Create (or fetch) a device and download a config for it
device = vpn.api.devices.get("test", create=True)
vpn.api.generator.download("config-directory", "earth", device.id)
Defer login, if you need to construct the object before credentials are available (e.g. in a CLI or app that prompts for them later):
from airvpn import AirVPN
vpn = AirVPN()
# ... later, once you have credentials ...
vpn.login(username, password)
print(vpn.client.name)
Skip the web login entirely, if you already have an API key secret saved from a previous session:
import os
from dotenv import load_dotenv
load_dotenv()
from airvpn import AirVPN
vpn = AirVPN(api_key=os.getenv("API_KEY"))
device = vpn.api.devices.get("test", create=True)
AirClient
An AirVPN instance always has a bootstrap client available, no login required, for public data like server manifests:
from airvpn import AirVPN
vpn = AirVPN()
manifest = vpn.bootstrap.manifest()
print(manifest.time)
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
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
File details
Details for the file airvpn-0.2.6.tar.gz.
File metadata
- Download URL: airvpn-0.2.6.tar.gz
- Upload date:
- Size: 55.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via:
twine/6.2.0 CPython/3.14.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8acff1afdd8a2ad45f6a0b976fad17e750cca4870118691a558b2cec40b9822d
|
|
| MD5 |
3c1b9ff66bd620aaf356c0d03e68577c
|
|
| BLAKE2b-256 |
416394836abc2cd4fa42f759cd01df700bd68f83c1d1cb5429217d5bff6960a5
|
File details
Details for the file airvpn-0.2.6-py3-none-any.whl.
File metadata
- Download URL: airvpn-0.2.6-py3-none-any.whl
- Upload date:
- Size: 68.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via:
twine/6.2.0 CPython/3.14.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1d562a4005f6df2ef2ea0f880f7266e78bbbd7f2a86bcdc2583c96a2ed18254b
|
|
| MD5 |
6a1864a032bfe5174fd7fc90e228a9a2
|
|
| BLAKE2b-256 |
f0c9ced6cf40a5431eda309d3da3f3f5d2654a74d9323e4d56f10b0b111765d6
|