In this example, we'll run through a few basic commands using the SDK. We'll import the SDK, create a , and launch a .
The SDK is bundled with the .
NOTE: We'll be adding a Jupyter Notebook template that you can run on your own.
Getting Started
This assumes that you have the environment variable PAPERSPACE_API_KEY set to your api key. If you are using a Paperspace environment it is recommend to . If you are using an interactive environment use the gradient apiKey command to securely configure your api key.
#Import the SDK Client from the gradient package
from gradient import sdk_client
#Set some variables
project = "prkr4412y" # Set your project
cluster = "cl8pwu9qn" # Set your cluster
#Set your SDK client
deployment_client = sdk_client.DeploymentsClient()
models_client = sdk_client.ModelsClient()
jobs_client = sdk_client.JobsClient()
projects_client = ProjectsClient()
experiment_client = sdk_client.ExperimentsClient()
workflows_client = sdk_client.WorkflowsClient()
#or access them all from a single client
#client = sdk_client.SdkClient()
Print list of projects
projects_list = projects_client.list()
for project in projects_list:
print("project_id: "+project.id +" project_name: "+ project.name)
Create project
#create a new project
project_id = projects_client.create("sample_tutorials")
print("project_id: "+proj_id)