Skip to main content

Python AirVPN

Python versions PyPI version License Tests

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 four interfaces, depending on how much control you need:

  • AirVPN — high-level wrapper; the best starting point for most use cases
  • AirClient — low-level client for the encrypted bootstrap API (servers, manifest, status)
  • AirAPI — client for AirVPN's authenticated REST API (devices, config generation, keys)
  • 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

airvpn-0.2.8.tar.gz (55.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

airvpn-0.2.8-py3-none-any.whl (69.7 kB view details)

Uploaded Python 3

File details

Details for the file airvpn-0.2.8.tar.gz.

File metadata

  • Download URL: airvpn-0.2.8.tar.gz
  • Upload date:
  • Size: 55.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for airvpn-0.2.8.tar.gz
Algorithm Hash digest
SHA256 826e6f9b9c560461df9b72a9f2339ae5e42b3601d8c24d7f40888b3a1e87617c
MD5 3667623b8fbed9bf5133a0e81e7b5f35
BLAKE2b-256 efb9e618bcdcc6da1b515121dd59310b9029e5b9730274d26e3c907f5412777d

See more details on using hashes here.

Provenance

The following attestation bundles were made for airvpn-0.2.8.tar.gz:

Publisher: python-publish.yml on ch0nker/airvpn

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file airvpn-0.2.8-py3-none-any.whl.

File metadata

  • Download URL: airvpn-0.2.8-py3-none-any.whl
  • Upload date:
  • Size: 69.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for airvpn-0.2.8-py3-none-any.whl
Algorithm Hash digest
SHA256 16d87d517036ce5b774d7b873b7bb1ff2a090346ce5c13ff74d69d3532ed848f
MD5 6bdd0d8a24ea1a2f655e474adb2095d9
BLAKE2b-256 f39d2d0ef7da4c96b379507b8f39f67721b0c6b57561f41a79bc510a5b63e403

See more details on using hashes here.

Provenance

The following attestation bundles were made for airvpn-0.2.8-py3-none-any.whl:

Publisher: python-publish.yml on ch0nker/airvpn

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Release history Release notifications | RSS feed

0.2.13

2 files

0.2.12

2 files

0.2.11

2 files

0.2.10

2 files

0.2.9

2 files

This release

0.2.8 This release

2 files

0.2.7

2 files

0.2.6

2 files

0.2.5

2 files

0.2.3

2 files

0.2.0

2 files

0.1.12

2 files

0.1.11

2 files

0.1.10

1 file

0.1.9

2 files

0.1.8

2 files

0.1.7

2 files

0.1.6

2 files

0.1.5

2 files

0.1.4

2 files

0.1.3

2 files

0.1.2

2 files

0.1.1

2 files

0.1.0

2 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page