protonne
Python bindings for proton vpn's linux cli.
Installation
Install with:
pip install protonne
NOTE: This package requires that you have a Proton VPN account and that you've installed and set up the Proton VPN Linux CLI.
Usage
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
Metadata
Release files for protonne 1.0.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| protonne-1.0.0.tar.gz | 4.4 kB | Without provenance | Details for protonne-1.0.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| protonne-1.0.0-py3-none-any.whl | Python 3 | none | any | Details for protonne-1.0.0-py3-none-any.whl |
Total release size: 9.5 kB
Release files / protonne-1.0.0.tar.gz
| Download URL | protonne-1.0.0.tar.gz |
|---|---|
| Size | 4.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
4910f368ce164078571a11126022b794abd47f7e5a1d073c060a3a8bd1bd0de9
|
|
BLAKE2b-256 checksum How to use checksums |
a30e6930e052f20eb350600a79105ec2e8fdcbe676d3ab6f9fae24391f852fff
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.11.0
|
Release files / protonne-1.0.0-py3-none-any.whl
| Download URL | protonne-1.0.0-py3-none-any.whl |
|---|---|
| Size | 5.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
5dc9ab686167ee57a8d24fd91814c70e4b8739f64f9c870358263e8651eb2134
|
|
BLAKE2b-256 checksum How to use checksums |
a4bf934faea6af2862743f8a6157a93f2ab9d16560be509d2f8c609fc9a588a3
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.11.0
|
Security for protonne 1.0.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.