python package for XPARO
X.P.A.R.O is an innovative platform designed to provide remote management and control for various projects.
Website: https://xparo-website.onrender.com
GitHub Repository: https://github.com/lazyxcientist/xparo_remote
Contact: xpassistantpersonal@gmail.com
Requirements: websocket_client
Getting Started with X.P.A.R.O
Follow these steps to use X.P.A.R.O effectively:
Visit the Dashboard and create a new project by clicking on the “Add New” button.
Go to your newly created project.
Copy the
project_id
(orsecret_key
if any) of your project.Copy the API code provided below and paste your keys there.
To add a remote, hover over the menu at the top corner and navigate to the control icon.
Choose any custom remote or create a new remote.
Using the API
Basic Setup
from xparo import Project
xp = Project("email", "project_id", "secret_key_if_any")
Remote Controller
Every time you use the remote, the following function will be called:
from xparo import Project
xp = Project("email", "project_id", "secret_key_if_any")
# This function is called when new data is received from the remote
def remote_callback(command, remote_id):
print(command)
xp.remote_callback = remote_callback
# To send a custom remote command or use it as a remote
# Type 1: Send a remote command
xp.send("command")
# Type 2: Send a remote command with a unique remote ID
xp.send("command", "remote_id")
Sending Custom Errors
from xparo import Project
xp = Project("email", "project_id", "secret_key_if_any")
# Send an error command
xp.send_error("error")
# Type 2: Send an error command with a type of error
xp.send_error("error", "error type")
# Basic errors are sent automatically
Config Management
X.P.A.R.O allows you to manage your configuration while your project is deployed.
Change configurations at your Dashboard.
from xparo import Project
import os
xp = Project("email", "project_id", "secret_key_if_any")
# Set the config JSON file path
xp.config_path = os.path.join(os.path.dirname(__file__), 'config.json')
# This returns a dict of config
print(xp.config)
# Update or add the configuration globally
xp.update_config("key", "value")
# Add a callback to handle config changes
def config_changed(key, val):
print(key, val)
xp.config_callback = config_changed