pax_global_header00006660000000000000000000000064147061232540014516gustar00rootroot0000000000000052 comment=3ccfbc5aea6887ab8d8289166a312cc244884a28 python-mullvad-api-1.0.0/000077500000000000000000000000001470612325400152465ustar00rootroot00000000000000python-mullvad-api-1.0.0/PKG-INFO000066400000000000000000000020721470612325400163440ustar00rootroot00000000000000Metadata-Version: 2.1 Name: mullvad_api Version: 1.0.0 Summary: Python wrapper around mullvad api Home-page: UNKNOWN Author: meichthys License: UNKNOWN Description: # MullvadAPI Python wrapper around Mullvad api ## Installation ```bash pip install mullvad_api ``` ## QuickStart ```python >>> from mullvad_api import MullvadAPI >>> mullvad = MullvadAPI() >>> mullvad.data.keys() # List Mullvad API keys >>> mullvad.data["mullvad_exit_ip"] # Check if Mullvad VPN is active True >>> mullvad.data["ip"] # Check exit ip address '89.46.62.92' ``` Platform: UNKNOWN Classifier: Development Status :: 5 - Production/Stable Classifier: License :: OSI Approved :: MIT License Classifier: Natural Language :: English Classifier: Operating System :: OS Independent Classifier: Programming Language :: Python :: 3 Classifier: Topic :: System :: Networking Description-Content-Type: text/markdown python-mullvad-api-1.0.0/README.md000066400000000000000000000006261470612325400165310ustar00rootroot00000000000000# MullvadAPI Python wrapper around Mullvad api ## Installation ```bash pip install mullvad_api ``` ## QuickStart ```python >>> from mullvad_api import MullvadAPI >>> mullvad = MullvadAPI() >>> mullvad.data.keys() # List Mullvad API keys >>> mullvad.data["mullvad_exit_ip"] # Check if Mullvad VPN is active True >>> mullvad.data["ip"] # Check exit ip address '89.46.62.92' ``` python-mullvad-api-1.0.0/mullvad_api.py000066400000000000000000000012431470612325400201150ustar00rootroot00000000000000"""Contains the MullvadAPI class""" import requests class MullvadAPI: """ An object containing a dictionary representation of data returned by the Mullvad API """ def __init__(self): self.data = dict() self.api_url = "https://am.i.mullvad.net/json" self.update() def update(self): try: response = requests.get(self.api_url) self.data = response.json() except: raise MullvadAPIError( "Could not fetch Mullvad API data. Check your network connection." ) class MullvadAPIError(Exception): """Failed to fetch Mullvad API data.""" pass python-mullvad-api-1.0.0/setup.cfg000066400000000000000000000000461470612325400170670ustar00rootroot00000000000000[egg_info] tag_build = tag_date = 0 python-mullvad-api-1.0.0/setup.py000066400000000000000000000014431470612325400167620ustar00rootroot00000000000000import setuptools from os import path this_directory = path.abspath(path.dirname(__file__)) with open(path.join(this_directory, "README.md"), encoding="utf-8") as f: long_description = f.read() setuptools.setup( name="mullvad_api", version="1.0.0", author="meichthys", description="Python wrapper around mullvad api", long_description=long_description, long_description_content_type="text/markdown", install_requires=["requests"], py_modules=["mullvad_api"], classifiers=[ "Development Status :: 5 - Production/Stable", "License :: OSI Approved :: MIT License", "Natural Language :: English", "Operating System :: OS Independent", "Programming Language :: Python :: 3", "Topic :: System :: Networking", ], )