UNOFFICIAL Python bindings for Proxyrack Dashboard API
Project description
Proxyrack API
UNOFFICIAL Python bindings for Proxyrack Dashboard API
Installation
pip install pyProxyrack
Usage
Login with API Key:
from pyProxyrack import Proxyrack
# Your Proxyrack login email and password
API_KEY = "" # Generate an API key from your dashboard and store it here
# Initialise the Proxyrack object
user = Proxyrack()
# Optionally, when instantiating you can pass in the following attributes to the Proxyrack class:
| Attribute | Description | Default Value |
|---|---|---|
| API_BASE_URL | The API BASE URL | https://peer.proxyrack.com |
| API_PREFIX | The API PREFIX | /api |
| API_VERSION | The API VERSION | "" |
# Call the complete_login_flow method to login and set the JWT in self.jwt
user.set_api_key(API_KEY)
Add proxies for future requests:
from pyProxyrack import Proxyrack
# With authentication & protocol
user.set_proxy("ip:port:username:password", "socks5")
# Without authentication & protocol
user.set_proxy("ip:port", "socks5")
# Alternative way
user.set_socks5_proxy("ip:port")
user.set_socks5_proxy("ip:port:username:password")
user.set_https_proxy("ip:port")
user.set_https_proxy("ip:port:username:password")
Functions
-
Get device bandwidth
# Get device bandwidth used from date_start to date_end. user.get_device_bandwidth_usage(device_id: str, date_start: str, date_end: str)
device_idis required (if not passed, it'll combine the usage for all the devices and return the same) anddate_startanddate_endare optional and need the formatY-m-d(Eg: 2023-04-25)Do note you need to use
date_startanddate_endtogether even if you just want to use one.
-
Remove a proxy
# Removes a proxy for future requests. user.remove_proxy()
-
Add/link a device
# Add/link a device to your account user.add_device(device_id: str, device_name: str)
Both are required fields.
-
Delete/unlink a device
# Delete/unlink a device from your account user.delete_device(device_id: str)
-
Is Logged In
# Check if you're logged in user.is_logged_in()
-
Logout
# Logged out user.logout()
-
Get payout balance
# Get available payout balance user.get_balance()
Exceptions
- The following exceptions are defined.
Exception Reason NotLoggedInErrorRaised when you try to access protected routes (bandwidth usage, add devices, delete devices, etc).
Liked my work?
Consider donating:
-
BTC: bc1qh04l5tx7gd96wnyyqhr68uptdmqmwwwkcg3hj0
-
LTC: Lg5mMHUCrsSkaRYrfqaum4hodBAt9BSi91
Project details
Release history Release notifications | RSS feed
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 pyProxyrack-0.1.1.tar.gz.
File metadata
- Download URL: pyProxyrack-0.1.1.tar.gz
- Upload date:
- Size: 4.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.3.0 pkginfo/1.7.0 requests/2.27.1 setuptools/54.0.0 requests-toolbelt/0.9.1 tqdm/4.54.0 CPython/3.6.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
cd82c4b2d36bda5a2f5b974b8ebe06f7f9805ab83e45c54a76980b8406ae80e5
|
|
| MD5 |
7cd434ed68f885592198368f18c75233
|
|
| BLAKE2b-256 |
3ff5653a21db6564a7aadbea9925283ac1288d19a83eac4e1ab67b5f643fb7ae
|
File details
Details for the file pyProxyrack-0.1.1-py3-none-any.whl.
File metadata
- Download URL: pyProxyrack-0.1.1-py3-none-any.whl
- Upload date:
- Size: 5.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.3.0 pkginfo/1.7.0 requests/2.27.1 setuptools/54.0.0 requests-toolbelt/0.9.1 tqdm/4.54.0 CPython/3.6.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e03cbed8f6c2fc0f33e6bd7a3d293bb4a91c09c06631de4fe00f08f5a3297ef6
|
|
| MD5 |
6288dc04091faaf71d169aa6dcab7b97
|
|
| BLAKE2b-256 |
40f1582ae14f5f7e3e34a850c5bdc380edf29876d8d6595c166a7a2d02e4428e
|