The Virtualitics Python API (pyVIP) allows you to integrate Virtualitics with other products and services.
pyVIP is the Python package that houses the Virtualitics Python API and was developed for Python 3 (pyVIP is compatible with Python 3.8 through 3.11).
Make sure you are using the latest version of Virtualitics Explore or Virtualitics Explore Desktop, which can be accessed or downloaded from the Virtualitics Account Portal.
Installing the Virtualitics Python API (pyVIP)
From an appropriate terminal window, run the following line to install the Virtualitics Python API (pyVIP):
$> pip install pyVIP
It is recommended that you regularly update your pyVIP version so that you can use the latest functionalities that we’ve built into the package. To update your pyVIP package, run the following line from an appropriate terminal window:
$> pip install –-upgrade pyVIP
To verify that you have the correct version of pyVIP, run the following command from an appropriate terminal window:
$> python -c “import virtualitics; print(virtualitics.__version__);”
You should see the version number printed to the prompt. For example, you may see “1.18.0”.
Installing from Wheel
You can download the package wheel directly from here.
Setting Up the Virtualitics Python API (pyVIP) in Virtualitics Explore
There are two primary steps to set up the Virtualitics Python API. First, you'll need to have an API Token generated from the Virtualitics Account Portal. Then, you'll need to set up your API configuration in Virtualitics Explore.
Generate an API Token from the Virtualitics Account Portal
To generate an API Token from the Virtualitics Account Portal:
- Log into the Virtualitics Account Portal.
- Navigate to the My Account tab.
- Scroll down to the Tokens and Keys section.
- Click Generate to generate your API Token.
Set up the API Token
If you have administrator privileges on your machine, you can set an environment variable called “VIP_AUTH_TOKEN” with the token generated from the Virtualitics Account Portal so that you do not have to specify this each time you instantiate the VIP class.
To do this, follow these steps:
- Open the Control Panel from the Start Menu.
- Click on System and Security and then System.
- Click on Advanced system settings from the list on the left and then click on the Environment Variables… button in the window that appears. You will then see a list of your User variables and System variables.
- Click on New… under the User variables section.
- In the Variable name field, enter
VIP_AUTH_TOKEN
. - In the Variable value field, paste the API Token generated from the Virtualitics Account Portal. Do not include quotation marks.
If you do not have administrator privileges on your machine, you will need to include this API token each time you instantiate the VIP class:
from virtualitics import api
explore = api.VIP(#INSERT API TOKEN HERE#)
After setting your new environment variables, please close your current prompt and open a new prompt to pull the variables into context.
Set up your API Configuration in Virtualitics Explore
To update Virtualitics Explore with your API configuration:
- Open Virtualitics Explore or Virtualitics Explore Desktop and sign in with the same credentials you used when accessing the Virtualitics Account Portal.
- Open the Settings window by clicking on the Gear icon ( ) located in the upper right of the toolbar.
- In the left panel of the Settings menu, navigate to the API section:
- Port Configuration: This is where you specify the port number you would like Virtualitics Explore’s API WebSocket-Server to utilize. The default Port Configuration is 12345. If you are unsure what to specify, we recommend you speak with your IT department or consult with support@virtualitics.com.
- Encryption Key: Set this to the same key you saved as an environment variable. If you did not specify the environment variable for “VIP_ENCRYPTION_KEY”, you can leave this cell blank.
- If you would like the Virtualitics Explore API WebSocket Server to launch every time you sign into Virtualitics Explore, please select the Launch server on login checkbox (recommended).
Next Article |