protonne


Nameprotonne JSON
Version 1.0.0 PyPI version JSON
download
home_page
SummaryPython bindings for proton vpn's cli.
upload_time2024-02-17 19:33:25
maintainer
docs_urlNone
author
requires_python>=3.10
license
keywords autorotate proton protonvpn rotate vpn
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # protonne

Python bindings for proton vpn's linux cli.

## Installation

Install with:

<pre>
pip install protonne
</pre>

### **NOTE**: This package requires that you have a Proton VPN account and that you've installed and set up the [Proton VPN Linux CLI](https://protonvpn.com/support/linux-vpn-tool/).

## Usage

<pre>
from protonne import Proton
proton = Proton()
proton.connect_fastest()
proton.enable_permanent_killswitch()

# If you want to execute the commands "silently", you can set 'capture_output' to True in the class constructor or after creation through the 'capture_output' property
proton.capture_output = True
proton.capture_output = False
# Almost every function returns an 'Output' object that contains 3 fields: 'return_code', 'stdout', and 'stderr'.
# When 'capture_output' is True, 'stdout' and 'stderr' can be accessed through the 'Output' object, otherwise they are empty strings.
# The 'capturing_output()' context manager can also be used.
with proton.capturing_output():
    output = proton.connect_random()
    print(output.stdout)

# Once you're connected, info about the connection is available through the 'connection' property.
# Accessing this property invokes the cli's 'status' command and parses the output into a 'Connection' object.
# For performance, it's best to store this property in a local variable for repeated access until you need an updated 'Connection' object.
ip_history = []
connection = proton.connection
ip_history.append((connection.IP, connection.server.name))
proton.connect_random()
connection = proton.connection
ip_history.append((connection.IP, connection.server.name))
proton.connect(server=ip_history[0][1])

# Full 'Connection' annotation:
connection.IP: str
connection.killswitch.active: bool
connection.killswitch.on: bool
connection.killswitch.permanent: bool
connection.raw: str # The raw output string of the 'status' cli command
connection.server.name: str
connection.server.country: str
connection.server.protocol: str
connection.server.load: str
connection.server.plan: str
connection.server.features: str | None
connection.time: str
</pre>

            

Raw data

            {
    "_id": null,
    "home_page": "",
    "name": "protonne",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.10",
    "maintainer_email": "",
    "keywords": "autorotate,proton,protonvpn,rotate,vpn",
    "author": "",
    "author_email": "Matt Manes <mattmanes@pm.me>",
    "download_url": "https://files.pythonhosted.org/packages/a3/0e/6930e052f20eb350600a79105ec2e8fdcbe676d3ab6f9fae24391f852fff/protonne-1.0.0.tar.gz",
    "platform": null,
    "description": "# protonne\n\nPython bindings for proton vpn's linux cli.\n\n## Installation\n\nInstall with:\n\n<pre>\npip install protonne\n</pre>\n\n### **NOTE**: This package requires that you have a Proton VPN account and that you've installed and set up the [Proton VPN Linux CLI](https://protonvpn.com/support/linux-vpn-tool/).\n\n## Usage\n\n<pre>\nfrom protonne import Proton\nproton = Proton()\nproton.connect_fastest()\nproton.enable_permanent_killswitch()\n\n# If you want to execute the commands \"silently\", you can set 'capture_output' to True in the class constructor or after creation through the 'capture_output' property\nproton.capture_output = True\nproton.capture_output = False\n# Almost every function returns an 'Output' object that contains 3 fields: 'return_code', 'stdout', and 'stderr'.\n# When 'capture_output' is True, 'stdout' and 'stderr' can be accessed through the 'Output' object, otherwise they are empty strings.\n# The 'capturing_output()' context manager can also be used.\nwith proton.capturing_output():\n    output = proton.connect_random()\n    print(output.stdout)\n\n# Once you're connected, info about the connection is available through the 'connection' property.\n# Accessing this property invokes the cli's 'status' command and parses the output into a 'Connection' object.\n# For performance, it's best to store this property in a local variable for repeated access until you need an updated 'Connection' object.\nip_history = []\nconnection = proton.connection\nip_history.append((connection.IP, connection.server.name))\nproton.connect_random()\nconnection = proton.connection\nip_history.append((connection.IP, connection.server.name))\nproton.connect(server=ip_history[0][1])\n\n# Full 'Connection' annotation:\nconnection.IP: str\nconnection.killswitch.active: bool\nconnection.killswitch.on: bool\nconnection.killswitch.permanent: bool\nconnection.raw: str # The raw output string of the 'status' cli command\nconnection.server.name: str\nconnection.server.country: str\nconnection.server.protocol: str\nconnection.server.load: str\nconnection.server.plan: str\nconnection.server.features: str | None\nconnection.time: str\n</pre>\n",
    "bugtrack_url": null,
    "license": "",
    "summary": "Python bindings for proton vpn's cli.",
    "version": "1.0.0",
    "project_urls": {
        "Documentation": "https://github.com/matt-manes/protonne/tree/main/docs",
        "Homepage": "https://github.com/matt-manes/protonne",
        "Source code": "https://github.com/matt-manes/protonne/tree/main/src/protonne"
    },
    "split_keywords": [
        "autorotate",
        "proton",
        "protonvpn",
        "rotate",
        "vpn"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "a4bf934faea6af2862743f8a6157a93f2ab9d16560be509d2f8c609fc9a588a3",
                "md5": "5186021fbf4262727d0e2d6a48cca591",
                "sha256": "5dc9ab686167ee57a8d24fd91814c70e4b8739f64f9c870358263e8651eb2134"
            },
            "downloads": -1,
            "filename": "protonne-1.0.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "5186021fbf4262727d0e2d6a48cca591",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.10",
            "size": 5096,
            "upload_time": "2024-02-17T19:33:23",
            "upload_time_iso_8601": "2024-02-17T19:33:23.671326Z",
            "url": "https://files.pythonhosted.org/packages/a4/bf/934faea6af2862743f8a6157a93f2ab9d16560be509d2f8c609fc9a588a3/protonne-1.0.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "a30e6930e052f20eb350600a79105ec2e8fdcbe676d3ab6f9fae24391f852fff",
                "md5": "5de0b22b31e327bf5c0ac96d6da8225a",
                "sha256": "4910f368ce164078571a11126022b794abd47f7e5a1d073c060a3a8bd1bd0de9"
            },
            "downloads": -1,
            "filename": "protonne-1.0.0.tar.gz",
            "has_sig": false,
            "md5_digest": "5de0b22b31e327bf5c0ac96d6da8225a",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.10",
            "size": 4422,
            "upload_time": "2024-02-17T19:33:25",
            "upload_time_iso_8601": "2024-02-17T19:33:25.144641Z",
            "url": "https://files.pythonhosted.org/packages/a3/0e/6930e052f20eb350600a79105ec2e8fdcbe676d3ab6f9fae24391f852fff/protonne-1.0.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-02-17 19:33:25",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "matt-manes",
    "github_project": "protonne",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "lcname": "protonne"
}
        
Elapsed time: 3.13730s