Install and initialize the ValidMind Library
Initialize the ValidMind Library with the code snippet unique to each record (model) per document to connect your environment to the ValidMind Platform, ensuring test results are uploaded to the correct record and automatically populated in the right document.
Prerequisites
Installing the ValidMind Library
In order to upload test results from the ValidMind Library to the ValidMind Platform, provide the following information through a code snippet copied from the platform:
| Argument | Description |
|---|---|
api_host |
The location of the ValidMind API |
api_key |
The account API key |
api_secret |
The account secret key |
document |
The record document identifier key |
model |
The record identifier |
Get your code snippet
Retrieve your code snippet for your record's selected document from the ValidMind Platform:
In the left sidebar, click Inventory.
Select the type of
{Record}you want to retrieve the code snippet for by clicking on {Record} Inventory.4Select a record by clicking on it or find your record by applying a filter or searching for it.5
In the left sidebar that appears for your record, click Getting Started.
Select the Document you want to automatically upload test results to.6
Click Copy snippet to clipboard.
Install the library
To install the library:
%pip install validmindInitialize the library
To initialize the library, paste the code snippet with the client integration details directly into your development source code, replacing this example with your own:
import validmind as vm
vm.init(
api_host = "https://API_HOST.validmind.ai/api/v1/tracking",
api_key = "API_KEY",
api_secret = "API_SECRET",
document="document-key", # requires library >=2.12.0
model = "MODEL_IDENTIFIER"
)If your organization enables OIDC library connectivity, you can authenticate with the device authorization flow instead of api_key and api_secret. See Authenticate with OIDC device flow.
Automate with ValidMind
After you run the code snippet in your environment, the ValidMind Library will connect to your record and selected document in the ValidMind Platform. Automate your workflow by using the library to run tests, then seamlessly upload your test results to the platform.
Upgrade the ValidMind Library
After installing the ValidMind Library,9 you'll want to periodically make sure you are on the latest version to access any new features and other enhancements:
In your Jupyter Notebook or developer environment, retrieve the information for the currently installed version of the library:
%pip show validmind
Example output:
Name: validmind
Version: 2.11.0
...If the version returned is lower than the version indicated in our production open-source code,10 run the following command:
%pip install --upgrade validmind
10 ValidMind GitHub: validmind-library/validmind/__version__.py