Installing the TopQAD SDK
Follow these steps to set up a local environment for developing and testing the SDK.
1. Create and Activate a Virtual Environment
There are many tools that can be used to create a virtual environment. We will demonstrate Python's built in venv module, which creates an isolated Python environment for the project so that we can avoid mismatching dependencies with already installed Python packages.
Open your terminal and navigate to your project folder.
Create the virtual environment:
python3 -m venv .venv
Activate the environment: macOS / Linux:
source .venv/bin/activate
Windows:
.\.venv\Scripts\activate
Your terminal prompt should now begin with (.venv)
.
Update pip to ensure it has access to all the dependencies we need to install:
python -m pip install -U pip
2. Install the Package
Use pip to install TopQAD and all related dependencies
pip install topqad_sdk
3. Get Your Refresh Token (Required for Authentication)
To use the SDK, you need a TOPQAD_REFRESH_TOKEN
from the TopQAD portal.
- Visit the TopQAD portal.
- Go through the registration process and log in.
- Click your profile picture in the top right.
- Select "Get refresh token".
- Copy the token shown.
⚠️ Security Note: Your refresh token is as sensitive as a password. Keep it safe and never commit it to source control.
Set the environment variable directly in your shell or navigate to the directory where you will be running Python and use the command below to store your refresh token in a .env
file (replace PASTE_YOUR_TOKEN with the value of your token):
echo TOPQAD_REFRESH_TOKEN="PASTE_YOUR_TOKEN_HERE" >> .env
4. Verify the Installation
Run the following to check that the topqad_sdk
package is installed, see its version, and confirm the installation path:
pip show topqad_sdk
License
This project is licensed under the Apache 2.0 License.